Paul's Petrov Whiteboard

[BizTalk, Enterprise Application Integration, Business Process Automation, SOA, .NET]

  Home  |   Contact  |   Syndication    |   Login
  67 Posts | 1 Stories | 133 Comments | 30 Trackbacks

News

Archives

Post Categories

Image Galleries

BizTalk

Other

Recently, while debugging desktop client - WCF service application I came across this error:

System.ServiceModel.Security.MessageSecurityException was caught
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.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
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& msgData, Int32 type)

InnerException: System.ServiceModel.FaultException
Message=”An error occurred when verifying security for the message.”

Client was connecting basic http binding with security mode TransportWithMessageCredential. All other desktop clients were able to successfully call WCF service but not this particular one. Thanks to this post the issue was quickly understood and resolved. Apparently, the client machine was a brand new netbook just out of the box and clock was way off. Interesting thing that Windows automatic clock synchronization did not work.

 

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati
posted on Tuesday, August 11, 2009 9:59 AM

Feedback

# re: WCF Message Authentication Failure 10/30/2009 1:15 PM Fábio Demarchi
Try to disable the synchronizing computer time with an Internet time server, following these steps:

*** If you are a member of a domain, just ignore my tip, 'cos in this case the "Internet Time" tab does not appear for you.

1. Double-click the time on the Windows XP Taskbar to open the "Date and Time Properties" multi-tabbed dialog box;
2. When this dialog box appears, click the "Internet Time" tab;
3. Uncheck "Automatically synchronize with an Internet time server";
4. Don't forget to check/adjust your clock;
5. Click "OK" to close the dialog box;
6. Finally, proceed with your test!

Let me know if this helped you.
All the best,

Fábio Demarchi
Systems Analyst
fabiodemarchi@gmail.com
fabiodemarchi@googlewave.com

# re: WCF Message Authentication Failure 11/24/2009 2:21 AM Dev
Yes, it really works. Thanks alot

# re: WCF Message Authentication Failure 1/13/2010 2:36 AM loverwei
it works well,but why?

# re: WCF Message Authentication Failure 2/4/2010 12:14 PM DavidHalligan
I would be guessing but, message authentication in WCF by default encrypts the credentials. Encryption usually depends upon some type of salt / seed which can be based upon the current system time. My guess is that the date / time on the client and server is not insignificantly out of step resulting in the encryption / decryption failing.

# re: WCF Message Authentication Failure 3/9/2010 2:48 PM Gregg McGilvray
Thanks, you saved me a ton of time. My servers were off by less than 5 minutes and failed. hen I synced them my app ran fine.

# re: WCF Message Authentication Failure 3/26/2010 11:43 PM Vishal
Hey Thanks a lot!! it saved my time. I was too facing the same Error. :)

# re: WCF Message Authentication Failure 5/16/2010 6:51 PM Cav
I have the same error and everywhere I look I'm told it's a time synching issue- but I'm running client and server in dev on the same machine! argh!

# re: WCF Message Authentication Failure 6/8/2010 11:42 PM mortgage calculator
well its work for me,well done and thanks in advance

# re: WCF Message Authentication Failure 6/16/2010 10:49 AM komputer
thanks for posting i have been looking for this

# re: WCF Message Authentication Failure 6/29/2010 7:19 PM Ova
GRACIAS LOCO! SOS UN GROSO

# re: WCF Message Authentication Failure 8/17/2010 5:29 AM Dhivya
member of domain ..how to resolve..ideas?

# re: WCF Message Authentication Failure 10/15/2010 7:19 PM wcftest
I hava the same error and I'm using a nettcpbinding... can you help me ??

StackTrace = "\r\nServer stack trace: \r\n at System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan timeout)\r\n\r\nException rethrown at [0]: \r\n at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)\r\n at ...



# re: WCF Message Authentication Failure 4/12/2011 12:49 AM Santosh
but in case of wsHttpBinding it is not working

# re: WCF Message Authentication Failure 11/14/2011 3:28 PM Jim Miñano
How I can do if I want to allow connections from clients with more than 5 minutes apart because customers are from different countries?

# re: WCF Message Authentication Failure 11/14/2011 3:41 PM Paul
Increase maxClockSkew value to the desired time interval in the WCF binding configuration

Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: