OWIN ClaimsIdentity在IE11中不起作用

时间:2016-03-15 14:56:21

标签: asp.net-mvc owin

使用OWIN身份验证登录后,身份证明了身份验证'在IE11中总是假的。它在Chrome中运行得很好,但有什么想法吗?

我还重新加载了页面以查看辅助请求是否有效,但事实并非如此。我确实在IE的开发工具中看到了cookie。

throw ex;

如果有帮助,这是我的启动代码:

//Setup authentication
ClaimsIdentity identity = new ClaimsIdentity(new[] {
    new Claim(ClaimTypes.Name, userName),
    new Claim(ClaimTypes.NameIdentifier, webUser.User_ID.ToString())
}, "ApplicationCookie");    
request.GetOwinContext().Authentication.SignIn(identity);

//Check authentication
ClaimsIdentity identity = request.GetOwinContext().Authentication.User.Identity as ClaimsIdentity;         

if (!identity.IsAuthenticated) return null; // In IE11, 'IsAuthenticated' is always false and the identity is not a valid  claimsIdentity

0 个答案:

没有答案