asp.net-coreblazoropenid-connectblazor-webassemblyauth0

In Blazor WASM with with Open ID Connect how can you force an Auth/ID Token refresh


I have a Blazor WASM app integrated with my IdP via Open ID Connect. We need custom claims that are stored in the ID Token and Auth Token. This all works fine in the most part. However, there are a couple of expected situations where a particular process will update source data for these and so the data in the tokens has become stale. So in the app I would like to force the refreshing of these tokens from the IdP so they have the latest information.

I have tried, unsuccessfully, to find how to so this. However, my Google-fu must be off as I have not found anything that even points me in the right direction.

If it is relevant I am using .Net 8 and my IdP is Auth0.

Anyone have any pointers?


Solution

  • I resolved this in the end by redirecting back to the login URL. This forces a refresh of the auth token.

    NavigationManager.NavigateToLogin("authentication/login");