如何重写手动OWIN-曲奇(MVC5) [英] How to rewrite the OWIN-Cookie manually (MVC5)
问题描述
我用 IUserSecurityStampStore
实施注销无处不在的功能。这似乎很好地工作,但是我每次用户更改其密码的问题,她后来被注销。
I use the IUserSecurityStampStore
to implement sign-out-everywhere functionality. It seems to work fine, however I have the problem that every time the user changes her password, she is logged off afterwards.
一种可能性来解决这个问题,是调用签到
在管理
的清议的的AccountController
密码更改后。
One possibility to work around this issue, is to call SignIn
in the Manage
-Action of the AccountController
after a password change.
这似乎是工作,但我认为这是一个有点笨拙,可能不是正确的方式。
This seems to work, but I think it’s a bit clumsy and probably not the right way.
这就是为什么我的问题是:
Thats why my questions are:
- 如何强制OWIN重写cookie中当前登录的
用户? - 如果上面的方法是正确的方法,我怎么知道,如果用户希望
有她的Cookie持续性或不(签到希望这些信息)?
推荐答案
因此,样本和模板调用签到后用户做一些事情,导致安全戳改变。不幸的是,你不必恢复此方案中的cookie的持久状态的好方法,这是后话,我们将在以后的更新尝试的地址。
So the samples and templates call SignIn after the user does something that causes the security stamp to change. Unfortunately you do not have a great way to restore the persistent state of the cookie in this scenario, this is something we will try address in a future update.
我提交的问题以及解决这个问题的其它相关问题跟踪此: https://开头github.com/aspnet/Identity/issues/135
I filed an issue to track this along with the other related issues around this: https://github.com/aspnet/Identity/issues/135
这篇关于如何重写手动OWIN-曲奇(MVC5)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!