OnValidateIdentity禁用MVC OWIN记得我的选择 [英] OnValidateIdentity disables the MVC OWIN remember me option
问题描述
当我启动OWIN注销,通过无处不在的安全功能的邮票,并使用 OnValidateIdentity
的-Callback的 CookieAuthenticationProvider
与 SecurityStampValidator
级,用户每次他关闭浏览器时退出。
When I activate the OWIN logout-everywhere feature via security stamps and use the OnValidateIdentity
-Callback of the CookieAuthenticationProvider
with the SecurityStampValidator
-class, the user is logged out every time he closes the browser.
provider.OnValidateIdentity =
SecurityStampValidator.OnValidateIdentity<MyUserManager, MyUser>(
System.TimeSpan.FromSeconds(10),(manager, user) => {
return user.GenerateUserIdentityAsync(manager);
});
然而,当我做水暖自己在(查找和安全邮票比较,拒绝或更新身份)的 OnValidateIdentity
-callback,一切似乎都做工精细。
However, when I do the plumbing myself (lookup and comparison of the security stamps, rejecting or renewing the identity) in the OnValidateIdentity
-callback, everything seems to work fine.
这是一个已知的bug,或者我在这里错过了什么?或者是有关于 CookieAuthenticationProvider
和使用 OnValidateIdentity
?结果有一个好的文档
与谷歌挖只能说明我一些简单的样品,但没有给出进一步了解。
Is this a known bug, or do I miss here something? Or is there a good documentation about the CookieAuthenticationProvider
and the use of OnValidateIdentity
?
Digging with google only shows me some simple samples, but gives no further insight.
其他信息
- 我使用自己实现的UserStorage的节省一切
数据库中的数据 - 我注意到,每一个页面请求调用两次
在UserStorage,wheras当我用的GetSecurityStampAsync我
实施中,只有一个电话就完成了。 - 安装的版本的身份是2.0.1
推荐答案
这是在ASP.NET 2.2身份解决。请参见的https://aspnetidentity.$c$cplex.com/workitem/2319
This is resolved in ASP.NET Identity 2.2. See https://aspnetidentity.codeplex.com/workitem/2319
这篇关于OnValidateIdentity禁用MVC OWIN记得我的选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!