This project is read-only.

Is Windows Authentication supported?

Feb 1, 2011 at 5:55 AM

HI, 

I started taking a look at this but I got into big troubles when I integrated into my project. I'm using windows authentication in the web service and looks like the both features don't coexist for now :( 

I'm getting this error when I start running a client connecting to the WS. 

This is the last message the client is getting:

<s:Envelope xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:s="http://www.w3.org/2003/05/soap-envelope">  <s:Header>    <a:Action s:mustUnderstand="1">http://www.w3.org/2005/08/addressing/soap/fault</a:Action>    <a:RelatesTo>urn:uuid:d64d924e-9b6b-40bc-b119-2cdfe5eb5925</a:RelatesTo>  </s:Header>  <s:Body>    <s:Fault>      <s:Code>        <s:Value>s:Sender</s:Value>        <s:Subcode>          <s:Value xmlns:a="http://schemas.xmlsoap.org/ws/2005/02/sc">a:BadContextToken</s:Value>        </s:Subcode>      </s:Code>      <s:Reason>        <s:Text xml:lang="es-CR">The message could not be processed. This is most likely because the action 'http://tempuri.org/IService1/GetData' is incorrect or because the message contains an invalid or expired security context token or because there is a mismatch between bindings. The security context token would be invalid if the service aborted the channel due to inactivity. To prevent the service from aborting idle sessions prematurely increase the Receive timeout on the service endpoint's binding.</s:Text>      </s:Reason>    </s:Fault>  </s:Body></s:Envelope>

 

I tried setting the Receive timeout to 10 min, but it doesn't work. I really think that the compression channel is loosing or breaking the security context at some point. The exception thrown in the client is the following:

System.ServiceModel.Security.MessageSecurityException: An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail. ---> System.ServiceModel.FaultException: The message could not be processed. This is most likely because the action 'http://tempuri.org/IService1/GetData' is incorrect or because the message contains an invalid or expired security context token or because there is a mismatch between bindings. The security context token would be invalid if the service aborted the channel due to inactivity. To prevent the service from aborting idle sessions prematurely increase the Receive timeout on the service endpoint's binding.   --- End of inner exception stack trace ---
Server stack trace:    at System.ServiceModel.Security.SecuritySessionClientSettings`1.SecurityRequestSessionChannel.ProcessReply(Message reply, TimeSpan timeout, SecurityProtocolCorrelationState correlationState)   at System.ServiceModel.Security.SecuritySessionClientSettings`1.SecurityRequestSessionChannel.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.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 ConsoleApplication1.ServiceReference1.IService1.GetData(Int32 value)   at ConsoleApplication1.ServiceReference1.Service1Client.GetData(Int32 value) in C:\Users\david\Desktop\ConsoleApplication1\ConsoleApplication1\Service References\ServiceReference1\Reference.cs:line 116   at ConsoleApplication1.Program.Main(String[] args) in C:\Users\david\Desktop\ConsoleApplication1\ConsoleApplication1\Program.cs:line 15

Hopefully someone has already fixed this :)

/David