- What is your product version? v9.1.0-rc.1
- What is your product type (Angular or MVC)? Angular
- What is product framework type (.net framework or .net core)? .net core
I overrided CreateAsync to add a custom claim to user principal identity through UserClaimsPrincipalFactory and it works fine. I'm looking to modify this custom claim without relogin. I tried ReplaceClaimAsync method in UserManager and even called "await _signInManager.RefreshSignInAsync(user)" after updating claim but it didn't work. The claim modification is persisted in database but user session isn't affected until user relogin.
5 Answer(s)
-
0
hi
Angular is using JWT, so it can't be update. You can conside use
RefreshToken
method in Angular client to get a new token. -
0
Thank you.
I tried calling tryAuthWithRefreshToken in ZeroRefreshTokenService service but it didn't work since refreshToken cookie is always empty here. Please advice
-
0
Hi @kasem
Refresh token is used when user selects "remember me" checkbox.
-
0
Hi @ismcagdas
The problem that my users can't use RememberMe option. Do you have other way to achieve the needed?
Thanks
-
0
Hi @kasem
I can't offer you an alternative way. Angular app is storing JWT token and claims are stored in that token. So, you can't update it on the server. Best option is to use refresh token. If that's important for you, you can set RememberMe to true always in the code behind.