In standard OAuth authentication the browser is redirected to a remote token server where the login takes place. The token server redirects back to the application with an access token the Blazor application uses (Bearer) to access secured resources.
Blazor app Reload after B2C authentication
Why does a Blazor app completely reload/restart after B2C Authentication?
Here is the callback:
Thanks,
Mike
4 answers
Sort by: Most helpful
-
-
James Hamil 21,546 Reputation points Microsoft Employee
2021-11-05T21:35:25.177+00:00 Hi @Michael Lambert , @AgaveJoe is correct in his answer. The app needs to reload in order to pull resources from Azure in order to display related data. Please let me know if you have any questions!
Best,
James -
Michael Lambert 1 Reputation point
2021-11-19T23:16:41.027+00:00 I kinda understand the cause, but it leads to a horrid user experience. When logging in, right after the login screen disappears you can see that the app reacts to the successful login by updating the <AuthorizeView><Authorized>view on the page but then immediately reloads the app. Its like ripping the rug right out from under the user and making them wait another few seconds while the app reloads..
-
Bruce (SqlWork.com) 55,196 Reputation points
2021-11-20T15:40:36.03+00:00 The login code supports a pop up instead or redirect, but most browsers now block this, so the redirect is required. Security is also blocking iframe implementations.
If the hosting server supports authentication, you can do a simple api call to get a token instead of the oauth flow.