User.Identity.IsAuthenticatedalways returns falseASP.NET web APIs in my project.
In my account ApiController, I have the following:
ClaimsIdentity identity = new ClaimsIdentity(claims, DefaultAuthenticationTypes.ApplicationCookie);
AuthenticationManager.SignIn(new AuthenticationProperties() {
IsPersistent = isPersistent
}, identity);
After logging in, User.Identity.IsAuthenticatedalways falsein ApiController
but truein the MVC controller.
source
share