2017-09-05 105 views
0

UserManager類的AspnetIdentity中的UpdateSecurityStampAsync未更新OWIN IUserClaimsPrincipal。身份OWIN聲明中的UpdateSecurityStampAsync

UpdateSecurityStampAsync

測試重現:使用

  1. 登錄頁面ASPNET身份,上登錄以下

PasswordSignInAsync 明確地撥打電話,以更新安全戳 UpdateSecurityStampAsync

然後驗證context.User.Identity - 我期望看到更新的安全印章。但這似乎過時了。

如何更新卡塔納餅乾索賠,如果我們有像下面

 await _signInManager.PasswordSignInAsync() 
    if (result.Succeeded) 
       { 
    _userManager.UpdateSecurityStampAsync() 
} 

回答

0

SigninManager有一個方法更新相同的代碼。

//Refresh the cookie to update securitystamp on authenticationmanager responsegrant to the current request 
        await _signInManager.RefreshSignInAsync(user) 

;