身份OWIN声明中的UpdateSecurityStampAsync
问题描述:
UserManager类的AspnetIdentity中的UpdateSecurityStampAsync未更新OWIN IUserClaimsPrincipal。身份OWIN声明中的UpdateSecurityStampAsync
UpdateSecurityStampAsync
测试重现:使用
- 登录页面ASPNET身份,上登录以下
PasswordSignInAsync 明确地拨打电话,以更新安全戳 UpdateSecurityStampAsync
然后验证context.User.Identity - 我期望看到更新的安全印章。但这似乎过时了。
如何更新卡塔纳饼干索赔,如果我们有像下面
await _signInManager.PasswordSignInAsync()
if (result.Succeeded)
{
_userManager.UpdateSecurityStampAsync()
}
答
SigninManager有一个方法更新相同的代码。
//Refresh the cookie to update securitystamp on authenticationmanager responsegrant to the current request
await _signInManager.RefreshSignInAsync(user)
;