UpdateSecurityStampAsync in Identity OWIN claims

1k Views Asked by At

UpdateSecurityStampAsync in UserManager class of AspnetIdentity, is not updating the OWIN IUserClaimsPrincipal.

UpdateSecurityStampAsync

Test to reproduce:

  1. Login page using aspnet identity, on login following

PasswordSignInAsync explicitly make a call to update security stamp UpdateSecurityStampAsync

Then verify the context.User.Identity - I expected to see updated security stamp. but this seems to be old stil.

How to update Katana cookie claims if we have code like below

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

There are 1 best solutions below

0
On BEST ANSWER

SigninManager has a method update the same.

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

;