title: Is there a maximum Time Stamp Validity Duration when a client is set to a future datetime vs the server
body: <p>We set our Security on our custom Binding as below:</p>
  
  <pre><code>var lSecurity = lCustomBinding.Elements.Find&lt;TransportSecurityBindingElement&gt;();
                  lSecurity.LocalClientSettings.DetectReplays = false;
                  lSecurity.LocalServiceSettings.DetectReplays = false;
                  lSecurity.LocalClientSettings.TimestampValidityDuration = TimeSpan.FromDays(7);
                  lSecurity.LocalServiceSettings.TimestampValidityDuration = TimeSpan.FromDays(7);
                  lSecurity.LocalClientSettings.MaxClockSkew = TimeSpan.FromDays(7);
                  lSecurity.LocalServiceSettings.MaxClockSkew = TimeSpan.FromDays(7);
  </code></pre>
  
  <p>Now we find that if we test the above by setting the client back anywhere from now to 7 days back, it works. However, the moment we set the client anything more than 9 hours into the future, we get an exception.</p>
  
  <p>The only thing we found was some obscure reference at the end of another thread:</p>
  
  <p><a href="http://social.msdn.microsoft.com/Forums/en/wcf/thread/7c3a7a7e-b9a5-4198-9a29-c6d4e408d36d" rel="nofollow">http://social.msdn.microsoft.com/Forums/en/wcf/thread/7c3a7a7e-b9a5-4198-9a29-c6d4e408d36d</a></p>
  
  <p>Does anybody have any ideas?</p>
  
  <p><strong>UPDATE:</strong>
  The Exception we get is now added below. It seems as though the server rejects the client message:</p>
  
  <pre><code>System.ServiceModel.Security.MessageSecurityException occurred
    Message=An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail.
    Source=mscorlib
    StackTrace:
      Server stack trace: 
         at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.ProcessReply(Message reply, SecurityProtocolCorrelationState correlationState, TimeSpan timeout)
         at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout)
         at System.ServiceModel.Security.SecuritySessionSecurityTokenProvider.DoOperation(SecuritySessionOperation operation, EndpointAddress target, Uri via, SecurityToken currentToken, TimeSpan timeout)
         at System.ServiceModel.Security.SecuritySessionSecurityTokenProvider.RenewTokenCore(TimeSpan timeout, SecurityToken tokenToBeRenewed)
         at System.IdentityModel.Selectors.SecurityTokenProvider.RenewToken(TimeSpan timeout, SecurityToken tokenToBeRenewed)
         at System.ServiceModel.Security.SecuritySessionClientSettings`1.ClientSecuritySessionChannel.RenewKey(TimeSpan timeout)
         at System.ServiceModel.Security.SecuritySessionClientSettings`1.ClientSecuritySessionChannel.SecureOutgoingMessage(Message&amp; message, TimeSpan timeout)
         at System.ServiceModel.Security.SecuritySessionClientSettings`1.ClientSecurityDuplexSessionChannel.Send(Message message, TimeSpan timeout)
         at System.ServiceModel.Channels.ClientReliableChannelBinder`1.DuplexClientReliableChannelBinder`1.OnSend(TDuplexChannel channel, Message message, TimeSpan timeout)
         at System.ServiceModel.Channels.ReliableChannelBinder`1.Send(Message message, TimeSpan timeout, MaskingMode maskingMode)
         at System.ServiceModel.Channels.SendReceiveReliableRequestor.OnRequest(Message request, TimeSpan timeout, Boolean last)
         at System.ServiceModel.Channels.ReliableRequestor.Request(TimeSpan timeout)
         at System.ServiceModel.Channels.ClientReliableSession.Open(TimeSpan timeout)
         at System.ServiceModel.Channels.ClientReliableDuplexSessionChannel.OnOpen(TimeSpan timeout)
         at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
         at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
         at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
         at System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModel.Channels.ServiceChannel.ICallOnce.Call(ServiceChannel channel, TimeSpan timeout)
         at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)
         at System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpan timeout)
         at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
         at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
         at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
      Exception rethrown at [0]: 
         at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
         at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type)
         at CompuLoan.Maintenance.IMaintenanceService.IsLicensed(String pHardwareId, Boolean pUseLicense)
         at CompuLoan.Maintenance.MaintenanceServiceClient.IsLicensed(String pHardwareId, Boolean pUseLicense) in C:\Development\compuloan\Source\CompuLoan\Service References\Maintenance\Reference.cs:line 5156
         at CompuLoan.App.IsLicensed(Boolean pUseLicense) in C:\Development\compuloan\Source\CompuLoan\App.xaml.cs:line 365
    InnerException: System.ServiceModel.FaultException
         Message=The security context token is expired or is not valid. The message was not processed.
         InnerException: 
  </code></pre>