I'm using asp.net identity as my security framework, and I'm aware of regenerateIdentity
in my app.UseCookieAuthentication
.
I'm adding some claims to my user e.g. fullname, email that might be updated through profile page, how can I update current user claims when updating user profile?
Here is what i used, signout and signin again with this user using below method
private async Task SignInAsync(User user, bool isPersistent)
{
AuthenticationManager.SignOut(DefaultAuthenticationTypes.ExternalCookie);
var identity = await user.GenerateUserIdentityAsync(UserManager);
AuthenticationManager.SignIn(new AuthenticationProperties() { IsPersistent = isPersistent }, identity);
}