Trong việc thực hiện dịch vụ của tôi, tôi có:Cấu hình WCF Forms Authentication
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
Trong file .config của tôi, tôi có:
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
và:
<system.web.extensions> <scripting> <webServices> <authenticationService enabled="true" requireSSL = "false"/> </webServices> </scripting> </system.web.extensions>
và:
<authentication mode="Forms" />
Trong phương thức "Đăng nhập" cho dịch vụ của mình, tôi có:
FormsAuthentication.SetAuthCookie(request.UserName, false);
Tuy nhiên, khi tôi kiểm tra:
HttpContext.Current.User.Identity.Name
Đó là một chuỗi rỗng. Tôi đang thiếu gì?