User.Identity.IsAuthenticated
always returns false
in my ASP.NET Web API project.
In account ApiController
I have following:
ClaimsIdentity identity = new ClaimsIdentity(claims, DefaultAuthenticationTypes.ApplicationCookie);
AuthenticationManager.SignIn(new AuthenticationProperties() {
IsPersistent = isPersistent
}, identity);
After signing in, User.Identity.IsAuthenticated
is always false
in ApiController
but true
in MVC Controller.
The ApiController has a User property and is available from:
base.User.Identity.IsAuthenticated
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With