1 year ago
#63254
Roberto
Initialise user in Blazor application after registration in B2C and refresh token
I've got a Blazor WASM app that uses B2C to register new users. After the user registers, the user is redirected to the app with the right token.
However, after the registration I would like to initialise the user in the local DB and also I update some custom properties in B2C adding some Roles and other custom claims.
I can currently detect that, as I have a Custom Attribute called UserReady that I update in B2C once the User has been initialised using the GraphAPI.
I would like to Refresh the current user token after the values have been updated in B2C, so the current token contains the final values after the initialisation.
Is there a way in Blazor to call B2C to regenerate a new token with the updated values and replace the existing token? This could also help when the Admin assigns new roles, I could silently request an updated token for the current user after detecting the changes of roles to avoid having to sign out the user.
Alternatively, is there a "good way" to redirect to a CompleteRegistration page that after the completion the user can be logged out and redirected to do a log in again so they can get the updated token?
blazor
token
azure-ad-b2c
refresh-token
user-registration
0 Answers
Your Answer