Issues with authorization on Blazor WASM #54611
Labels
area-blazor
Includes: Blazor, Razor Components
✔️ Resolution: Duplicate
Resolved as a duplicate of another issue
Status: Resolved
Is there an existing issue for this?
Describe the bug
I am having an issue with Blazor WASM authentication which is reproduced here:
https://github.com/jahnotto/authfrust
Note that there is an
@attribute [Authorize]
at the top of the Home.razor page. Other than that, this is based on the Blazor wasm tempalte in Visual Studio 2023.When running locally, it works fine. However, after publishing it to an Azure App server, it doesn't work:
Chrome on Windows: if I open a new browser instance (after quitting the browser completetely), the page seems to forward to the usual "processing login", before it ends up with an error message saying "There was an error trying to log you in: '"undefined" is not valid JSON'". If I re-enter the URL or open another tab, it works fine. This happens regardless on whether I have been logged in previously.
Edge on Android tablet or Edge on iPad: In addition to the above behavor; if I remove the [Authorize] attribute on the Home page and click the Login button, a new tab is opened. The tab says "Completing login" and stays there forever.
Any clues?
Expected Behavior
The "Home" page should be shown after login with a newly opened browser, or immediately if user is already logged in.
Steps To Reproduce
Register an App ID and use that in appsettings.json in the mentioned repo
Publish the repo to an Azure app service
Exceptions (if any)
No response
.NET Version
8.0
Anything else?
No response
The text was updated successfully, but these errors were encountered: