WCF: An error occurred when processing the security tokens in the message

Sep 21 2011 5:14 AM
Hello Everyone,
 I am having a WCF service on basichttpbinding.
<basicHttpBinding> <binding name="BasicHttpBinding" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" transferMode="Buffered" useDefaultWebProxy="false"> <!--<binding name="BasicHttpBinding" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647000" maxBufferPoolSize="524288000" transferMode="Streamed">--> <!--<readerQuotas maxDepth="32" maxStringContentLength="8388608" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />--> <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/> <security mode="TransportWithMessageCredential" > <message clientCredentialType="UserName" algorithmSuite="Default"/> </security> </binding> </basicHttpBinding>

With Behaviour
<behavior name="WcfServiceDMS.Service1Behavior"> <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/> <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> <serviceDebug includeExceptionDetailInFaults="true"/> <dataContractSerializer maxItemsInObjectGraph="2147483647"/> <serviceCredentials> <clientCertificate> <authentication certificateValidationMode="None"/> </clientCertificate> <userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="WcfServiceDMS.AuthenticationModule, WcfServiceDMS"/> <!--<serviceCertificate findValue="neff.alis.i-engineering.com" x509FindType="FindByIssuerName" storeLocation="CurrentUser" storeName="TrustedPublisher" />--> </serviceCredentials> </behavior>
and endpoint
<service name="WcfServiceDMS.Service1" behaviorConfiguration="WcfServiceDMS.Service1Behavior"> <endpoint address="" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding" contract="WcfServiceDMS.IService1" /> <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" /> </service>

.
But while consuming this service.
I am getting exception An unsecured or incorrectly secured fault was received from the other party. and further An error occurred when processing the security tokens in the message. I cant find the reason why.
 I am running my wcf service on https protocol. I have put httpGetEnabled="true" httpsGetEnabled="true" both. but either way I am not able to get the expected answer.




Complete Exception:
System.ServiceModel.Security.MessageSecurityException was unhandled 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) at IPCClient.wcf.IService1.AuthenticateUser(String username, String password) at IPCClient.wcf.Service1Client.AuthenticateUser(String username, String password) in D:\TestLab\IPCClient\IPCClient\Service References\wcf\Reference.cs:line 1185 at IPCClient.Program.Main(String[] args) in D:\TestLab\IPCClient\IPCClient\Program.cs:line 61 at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) at System.AppDomain.nExecuteAssembly(RuntimeAssembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException: System.ServiceModel.FaultException Message=An error occurred when processing the security tokens in the message. InnerException:

Please someone come up with the solution.


Answers (1)