Configure WCF Form Authentication

In the implementation of my service, I have:

[AspNetCompatibilityRequirements (RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]

In my .config file, I have:

<serviceHostingEnvironment aspNetCompatibilityEnabled = "true" />

and

  <system.web.extensions>
    <scripting>
      <webServices>
        <authenticationService enabled = "true" requireSSL = "false" />
      </webServices>
    </scripting>
  </system.web.extensions>

and

<authentication mode = "Forms" />

In the Login method for my service, I have:

FormsAuthentication.SetAuthCookie (request.UserName, false);

However, when I check:

HttpContext.Current.User.Identity.Name

This is an empty string. What am I missing?

+5
3

, , .

.

+1

ServiceContext.User.Identity.

+1

, Identity.Name ?

web.config?

, cookie ?

0

All Articles