Hi,
We are trying to implement a feature where in the user role is updated when the user accepts the terms and conditions after login. After the user accepts the terms and conditions, the user will have to see additional menu items. We already have refresh token enabled for the client application but is unsure on how to refresh the token from blazor server manually and store it so that the token is used in the subsequent requests. Can you please provide some guidance on how to refresh the token in blazor server app?
- ABP Framework version: v7.3.1
- UI Type: Blazor Server
- Database System: EF Core (SQL Serve)
- Tiered (for MVC) or Auth Server Separated (for Angular): yes
4 Answer(s)
-
0
hi
You can call the
Challenge(new AuthenticationProperties { RedirectUri = your_returnUrl }, "oidc");
to get new access token.eg:
https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Authentication/ChallengeAccountController.cs#L81
-
0
Thank you so much for the response. We have a blazor server application, so we don't have access to httpcontext in razor components. So not sure on from where we have to invoke the Challenge method.
-
0
hi
You can add a controller or razor page to your blazor server project, and then redirect to its endpoint.
-
0
That worked. Thank you so much.