WCF Authentication Service Proxy - CookieContainer not available -


I have enabled the ASP.NET authentication service, as recommended by MSDN. Then I'm trying to use the service through the Console app or Winforms app (by adding a service reference for my local WCF service) I am doing custom authentication and transportation protection (so I'm using my Global.asax < / Code> In the AuthenticationService.Authenticating event that works fine.)

Authentication works fine on its own, but in the service context, add to the proxy Cookie Container Property not included This is clearly a problem when I try to pass a cookie token for later services which require authentication.

In addition, in the following client code, IsLoggedIn () incorrectly, I guess it is being assumed that no cookie container is present.

  ServiceReference1.AuthenticationServiceClient Client = New ServiceReference1.AuthenticationServiceClient (); Bool isLoggedIn = client.Login ("test", "test", "", true); // TRUE bool return check = client.IsLoggedIn (); // Returns Falls   

On this service my web. Configured:

  & lt; Configuration & gt; & Lt; System.web & gt; & Lt; Compilation debug = "true" targetFramework = "4.0" /> & Lt; /system.web> & Lt; System.web.extensions & gt; & Lt; Screening & gt; & Lt; Webservices & gt; & Lt; Authentication service enabled = "true" required SSL = "wrong" /> & Lt; / Webservices & gt; & Lt; / Script & gt; & Lt; /system.web.extensions> & Lt; System.serviceModel & gt; & Lt; Services & gt; & Lt; Service name = "System.Web.Application.Services.AuthenticationService" behaviorConfiguration = "AuthenticationServiceTypeBehaviours" & gt; & Lt; Endpoint Contract = "System Web Applications Services. Authentication Service" Binding = "Basic Httbinding" Binding Configuration = "User HTTPPS" Binding Namespace = "http://asp.net/ApplicationServices/v200" /> & Lt; / Services & gt; & Lt; / Services & gt; & Lt; Binding & gt; & Lt; BasicHttpBinding & gt; & Lt; Binding name = "userHttps" allow cookie = "true" & gt; & Lt ;! - & lt; Safety Mode = "Transportation" /> - & gt; & Lt; / Binding & gt; & Lt; / BasicHttpBinding & gt; & Lt; / Binding & gt; & Lt; Behavior & gt; & Lt; ServiceBehaviors & gt; & Lt; Behavior name = "Type authentication service" & gt; & Lt; ServiceMetadata httpGetEnabled = "true" /> & Lt; / Behavior & gt; & Lt; / ServiceBehaviors & gt; & Lt; / Behavior & gt; & Lt; Service hosting environment aspNetCompatibilityEnabled = "true" /> & Lt; /system.serviceModel> & Lt; / Configuration & gt; Edit: I should add a little more, I had to call the service intelligence session to  login , and the cookie is being set and it The customer has been sent back. But what should I do with a cookie container?  

When this option is enabled the client will ensure that it is received from a given web service All cookies are stored and sent right on every request in a transparent fashion. But there is a catch: The cookie is handled in conversation with only one web service. What if you need to send the same cookie to different web services?

If you need to send the same cookie to multiple services, read this article:

Comments