OnValidateIdentity禁用MVC OWIN记得我的选择 [英] OnValidateIdentity disables the MVC OWIN remember me option

查看:710
本文介绍了OnValidateIdentity禁用MVC OWIN记得我的选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我启动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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆