Closed Andrioden closed 6 years ago
Sounds like you are misunderstanding how these work, Both SignIn/Refresh typically result in the user you pass in being the User.Identitiy.Name. Refresh sign in just carries over the authentication mode claim from the currently signed in user. And then signs in the user you pass in.
@HaoK : Hmm. Are you sure? Why do the RefreshSignInAsync() method take an ApplicationUser input parameter then? If it just uses the User.Identitiy.Name anyway?
its the same thing as sign in basically, see https://github.com/aspnet/Identity/blob/dev/src/Identity/SignInManager.cs#L164
Hmm, I am sorry to be pushing this, but I am not convinced @HaoK : "The user to sign-in." and where the user derived princal.
It doesn't, it uses the claims principal you pass it
Environment:
By my understanding RefreshSignInAsync can be used to refresh roles for an user after you have given it new roles. However, when I do, all it does is log the CURRENT_USER user in as the CHANGING_USER user.
Here is a simplified, but still bugging version of the code, with comments of debugging state
On the redirect request I again check the debugging state to se which user data is present, and here the CHANGED_USER is now "logged in"
The same happens with
SignInManager.SignInAsync(dbUser, false, null);
UserManager.UpdateSecurityStampAsync(dbUser);
Have I