-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Description
Is there an existing issue for this?
- I have searched the existing issues
Is your feature request related to a problem? Please describe the problem.
I'm trying to renew the user's access token without needing to refresh the page.
Describe the solution you'd like
I'd like to call a function on something like IAccessTokenProvider.RenewUserToken
or RemoteAuthenticationService.RenewUserToken()
Additional context
Setup
I'm using the standard AddOidcAuthentication
extension with my .AddHttpClient(...).AddHttpMessageHandler(sp => sp.GetRequiredService<AuthorizationMessageHandler>().ConfigureHandler(...))
on multiple HttpClient
registrations.
Reason
Our JWT contains some dynamic data for multi-tenant use. So after certain user actions (i.e. switching tenants), they require a new JWT.
Attempts
Simply requesting a new JWT ourselves is insufficient as the other middleware needs to be notified of this.
Tried extending the RemoteAuthenticationService
class to trigger NotifyAuthenticationStateChanged
and various other functions, but seems like everything first checks for the (still valid) session token - so no renewal.
Couldn't see exactly what happens when the token expires, but it basically does what I want. Can that functionality be exposed somehow?