Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > WCF Certificate Authentication with Support Token

Reply
Thread Tools

WCF Certificate Authentication with Support Token

 
 
Andrew Bassett
Guest
Posts: n/a
 
      05-27-2009
I'm trying to create a simple client/service using WCF. I'm using Certificate
authentication and everything appears to work ok. However, when I add to my
binding a supporting token my whole program just falls apart. I get the
"Security protocol cannot verify the incoming message" error. I've included
the exception being thrown by the service.

<E2ETraceEvent
xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System
xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>131075</EventID><Type>3</Type><SubType
Name="Error">0</SubType><Level>2</Level><TimeCreated
SystemTime="2009-05-27T03:01:58.2746375Z" /><Source
Name="System.ServiceModel" /><Correlation
ActivityID="{e75836e7-5eb3-40c5-b3c1-0d2d1b5727be}" /><Execution
ProcessName="ComancheServer.vshost" ProcessID="4956" ThreadID="12" /><Channel
/><Computer>HDQRKHVFLEZ</Computer></System><ApplicationData><TraceData><DataItem><Trac eRecord
xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord"
Severity="Error"><TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.Diagnostics.ThrowingException. aspx</TraceIdentifier><Description>Throwing
an
exception.</Description><AppDomain>ComancheServer.vshost.exe</AppDomain><Exception><ExceptionType>System.Service Model.Security.MessageSecurityException,
System.ServiceModel, Version=3.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089</ExceptionType><Message>Message security
verification failed.</Message><StackTrace> at
System.ServiceModel.Security.MessageSecurityProtoc ol.VerifyIncomingMessage(Message&amp;
message, TimeSpan timeout, SecurityProtocolCorrelationState[]
correlationStates)
at
System.ServiceModel.Security.SecuritySessionServer Settings.ServerSecuritySessionChannel.ProcessReque stContext(RequestContext
requestContext, TimeSpan timeout, SecurityProtocolCorrelationState&amp;
correlationState, Boolean&amp; isSecurityProcessingFailure)
at
System.ServiceModel.Security.SecuritySessionServer Settings.ServerSecuritySessionChannel.ReceiveReque stAsyncResult.WaitComplete()
at
System.ServiceModel.Security.SecuritySessionServer Settings.ServerSecuritySessionChannel.ReceiveReque stAsyncResult..ctor(ServerSecuritySessionChannel
channel, TimeSpan timeout, AsyncCallback callback, Object state)
at
System.ServiceModel.Security.SecuritySessionServer Settings.ServerSecuritySessionChannel.BeginTryRece iveRequest(TimeSpan
timeout, AsyncCallback callback, Object state)
at
System.ServiceModel.Dispatcher.ReplyChannelBinder. BeginTryReceive(TimeSpan
timeout, AsyncCallback callback, Object state)
at
System.ServiceModel.Dispatcher.ErrorHandlingReceiv er.BeginTryReceive(TimeSpan
timeout, AsyncCallback callback, Object state)
at System.ServiceModel.Dispatcher.ChannelHandler.Ensu rePump()
at System.ServiceModel.Dispatcher.ChannelHandler.Open AndEnsurePump()
at
System.ServiceModel.Channels.IOThreadScheduler.Cri ticalHelper.WorkItem.Invoke2()
at System.Security.SecurityContext.Run(SecurityContex t securityContext,
ContextCallback callback, Object state)
at
System.ServiceModel.Channels.IOThreadScheduler.Cri ticalHelper.WorkItem.Invoke()
at
System.ServiceModel.Channels.IOThreadScheduler.Cri ticalHelper.ProcessCallbacks()
at
System.ServiceModel.Channels.IOThreadScheduler.Cri ticalHelper.CompletionCallback(Object state)
at
System.ServiceModel.Channels.IOThreadScheduler.Cri ticalHelper.ScheduledOverlapped.IOCallback(UInt32
errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at
System.ServiceModel.Diagnostics.Utility.IOCompleti onThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)
at
System.Threading._IOCompletionCallback.PerformIOCo mpletionCallback(UInt32
errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
</StackTrace><ExceptionString>System.ServiceModel.Se curity.MessageSecurityException:
Message security verification failed. ---&gt;
System.Security.Cryptography.CryptographicExceptio n: Digest verification
failed for Reference '#ae663432-f450-4944-8561-1c43030566ee'.
at System.IdentityModel.Reference.EnsureDigestValidit yIfIdMatches(String
id, Object resolvedXmlSource)
at System.IdentityModel.Reference.EnsureDigestValidit y(String id, Object
resolvedXmlSource)
at
System.ServiceModel.Security.WSSecurityOneDotZeroR eceiveSecurityHeader.ValidateDigestsOfTargetsInSec urityHeader(StandardSignedInfo
signedInfo, SecurityTimestamp timestamp, Boolean encryptedFormReaderRequired,
Boolean isPrimarySignature, Object signatureTarget, String id)
at
System.ServiceModel.Security.WSSecurityOneDotZeroR eceiveSecurityHeader.VerifySignature(SignedXml
signedXml, Boolean isPrimarySignature, SecurityHeaderTokenResolver resolver,
Object signatureTarget, String id)
at
System.ServiceModel.Security.ReceiveSecurityHeader .ProcessPrimarySignature(SignedXml signedXml, Boolean isFromDecryptedSource)
at
System.ServiceModel.Security.ReceiveSecurityHeader .ProcessEncryptedData(EncryptedData
encryptedData, TimeSpan timeout, Int32 position, Boolean eagerMode,
Boolean&amp; primarySignatureFound)
at
System.ServiceModel.Security.ReceiveSecurityHeader .ExecuteFullPass(XmlDictionaryReader reader)
at System.ServiceModel.Security.ReceiveSecurityHeader .Process(TimeSpan
timeout)
at
System.ServiceModel.Security.MessageSecurityProtoc ol.ProcessSecurityHeader(ReceiveSecurityHeader
securityHeader, Message&amp; message, SecurityToken requiredSigningToken,
TimeSpan timeout, SecurityProtocolCorrelationState[] correlationStates)
at
System.ServiceModel.Security.AcceptorSessionSymmet ricMessageSecurityProtocol.VerifyIncomingMessageCo re(Message&amp;
message, String actor, TimeSpan timeout, SecurityProtocolCorrelationState[]
correlationStates)
at
System.ServiceModel.Security.MessageSecurityProtoc ol.VerifyIncomingMessage(Message&amp;
message, TimeSpan timeout, SecurityProtocolCorrelationState[]
correlationStates)
--- End of inner exception stack trace
---</ExceptionString><InnerException><ExceptionType>Sys tem.Security.Cryptography.CryptographicException,
mscorlib, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089</ExceptionType><Message>Digest verification
failed for Reference
'#ae663432-f450-4944-8561-1c43030566ee'.</Message><StackTrace> at
System.IdentityModel.Reference.EnsureDigestValidit yIfIdMatches(String id,
Object resolvedXmlSource)
at System.IdentityModel.Reference.EnsureDigestValidit y(String id, Object
resolvedXmlSource)
at
System.ServiceModel.Security.WSSecurityOneDotZeroR eceiveSecurityHeader.ValidateDigestsOfTargetsInSec urityHeader(StandardSignedInfo
signedInfo, SecurityTimestamp timestamp, Boolean encryptedFormReaderRequired,
Boolean isPrimarySignature, Object signatureTarget, String id)
at
System.ServiceModel.Security.WSSecurityOneDotZeroR eceiveSecurityHeader.VerifySignature(SignedXml
signedXml, Boolean isPrimarySignature, SecurityHeaderTokenResolver resolver,
Object signatureTarget, String id)
at
System.ServiceModel.Security.ReceiveSecurityHeader .ProcessPrimarySignature(SignedXml signedXml, Boolean isFromDecryptedSource)
at
System.ServiceModel.Security.ReceiveSecurityHeader .ProcessEncryptedData(EncryptedData
encryptedData, TimeSpan timeout, Int32 position, Boolean eagerMode,
Boolean&amp; primarySignatureFound)
at
System.ServiceModel.Security.ReceiveSecurityHeader .ExecuteFullPass(XmlDictionaryReader reader)
at System.ServiceModel.Security.ReceiveSecurityHeader .Process(TimeSpan
timeout)
at
System.ServiceModel.Security.MessageSecurityProtoc ol.ProcessSecurityHeader(ReceiveSecurityHeader
securityHeader, Message&amp; message, SecurityToken requiredSigningToken,
TimeSpan timeout, SecurityProtocolCorrelationState[] correlationStates)
at
System.ServiceModel.Security.AcceptorSessionSymmet ricMessageSecurityProtocol.VerifyIncomingMessageCo re(Message&amp;
message, String actor, TimeSpan timeout, SecurityProtocolCorrelationState[]
correlationStates)
at
System.ServiceModel.Security.MessageSecurityProtoc ol.VerifyIncomingMessage(Message&amp;
message, TimeSpan timeout, SecurityProtocolCorrelationState[]
correlationStates)</StackTrace><ExceptionString>System.Security.Crypto graphy.CryptographicException:
Digest verification failed for Reference
'#ae663432-f450-4944-8561-1c43030566ee'.
at System.IdentityModel.Reference.EnsureDigestValidit yIfIdMatches(String
id, Object resolvedXmlSource)
at System.IdentityModel.Reference.EnsureDigestValidit y(String id, Object
resolvedXmlSource)
at
System.ServiceModel.Security.WSSecurityOneDotZeroR eceiveSecurityHeader.ValidateDigestsOfTargetsInSec urityHeader(StandardSignedInfo
signedInfo, SecurityTimestamp timestamp, Boolean encryptedFormReaderRequired,
Boolean isPrimarySignature, Object signatureTarget, String id)
at
System.ServiceModel.Security.WSSecurityOneDotZeroR eceiveSecurityHeader.VerifySignature(SignedXml
signedXml, Boolean isPrimarySignature, SecurityHeaderTokenResolver resolver,
Object signatureTarget, String id)
at
System.ServiceModel.Security.ReceiveSecurityHeader .ProcessPrimarySignature(SignedXml signedXml, Boolean isFromDecryptedSource)
at
System.ServiceModel.Security.ReceiveSecurityHeader .ProcessEncryptedData(EncryptedData
encryptedData, TimeSpan timeout, Int32 position, Boolean eagerMode,
Boolean&amp; primarySignatureFound)
at
System.ServiceModel.Security.ReceiveSecurityHeader .ExecuteFullPass(XmlDictionaryReader reader)
at System.ServiceModel.Security.ReceiveSecurityHeader .Process(TimeSpan
timeout)
at
System.ServiceModel.Security.MessageSecurityProtoc ol.ProcessSecurityHeader(ReceiveSecurityHeader
securityHeader, Message&amp; message, SecurityToken requiredSigningToken,
TimeSpan timeout, SecurityProtocolCorrelationState[] correlationStates)
at
System.ServiceModel.Security.AcceptorSessionSymmet ricMessageSecurityProtocol.VerifyIncomingMessageCo re(Message&amp;
message, String actor, TimeSpan timeout, SecurityProtocolCorrelationState[]
correlationStates)
at
System.ServiceModel.Security.MessageSecurityProtoc ol.VerifyIncomingMessage(Message&amp;
message, TimeSpan timeout, SecurityProtocolCorrelationState[]
correlationStates)</ExceptionString></InnerException></Exception></TraceRecord></DataItem></TraceData></ApplicationData></E2ETraceEvent>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference between Ajax Enabled WCF service and regular WCF? Cindy Lee ASP .Net 1 03-19-2010 05:59 PM
AJAX enabled WCF Service Vs Standard WCF Service Simon ASP .Net 0 10-13-2009 09:13 AM
WCF Custom Security Token - without certificate! Robertro ASP .Net Web Services 0 07-16-2009 06:18 AM
how to implement WCF Security using custom token Sarasam ASP .Net Web Services 0 04-18-2008 12:20 AM
preprocessor, token concatenation, no valid preprocessor token Cronus C++ 1 07-14-2004 11:10 PM



Advertisments