User.Identity.IsAuthenticated
总是返回false
在我的 ASP.NET Web API 项目中。
账户内ApiController
我有以下内容:
ClaimsIdentity identity = new ClaimsIdentity(claims, DefaultAuthenticationTypes.ApplicationCookie);
AuthenticationManager.SignIn(new AuthenticationProperties() {
IsPersistent = isPersistent
}, identity);
登录后,User.Identity.IsAuthenticated
总是false
in ApiController
but true
在 MVC 控制器中。
The API控制器 has a User财产,可从:
base.User.Identity.IsAuthenticated
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)