How to refresh claim of a different user than the one logged in during the current request?

徘徊边缘 提交于 2019-12-01 22:18:19

After searching a few days I discovered that what I want is not possible. You cannot force logging the user out without putting the cookie timespan to 0

options.Cookies.ApplicationCookie.ExpireTimeSpan = 0;

In this case it will check the cookie every time the user makes a request. With the following code you can than force the user to login again:

await _userManager.UpdateSecurityStampAsync(user);

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!