-
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
Describe the bug
I have a blazor web app with only interactive webassembly mode (prerendering disabled) secured with Entra ID as per https://learn.microsoft.com/en-us/aspnet/core/blazor/security/blazor-web-app-with-entra?view=aspnetcore-10.0&pivots=non-bff-pattern I'm using the NON bff pattern and without a downstream api.
My issue is that when the authentication token expires (default is roughly 1 hour) api calls just start giving errors with 301 found redirecting to the Entra login page. I would expect the auth state to refresh without giving errors.
My understanding is that Blazor wasm is not able to refresh auth state without a full page reload, so how should i handle this situation? Strangely i didn't find any documentation on this that i consider a pretty standard use case (maybe i didn't look well enough), so i guess i'm considering this a bug in the sample docs/app?
many thanks
Expected Behavior
Authentication state should gracefully refresh itself without backend api errors
Steps To Reproduce
Clone https://github.com/dotnet/blazor-samples/tree/main/10.0/BlazorWebAppEntra and run it.
login and then wait for the token to expire
Exceptions (if any)
No response
.NET Version
10.0.0
Anything else?
No response