-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Blazor WASM (.NET6) does not allow AAD Authentication when Deployed to Azure Web app #37206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Update: updated to the latest .NET Release Candidate and the issue is still occurring |
What do your App Registries look like? I had an issue like this and one of the App Registries had a bad set of URLs |
|
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
Update: Tried self-contained still didn't work. |
@javiercn have you checked with the Webapps team to see if it is an issue they can fix on their side? |
@javiercn my app is not misconfigured, it literally works on my machine with the same app ID and if I downgrade to .NET5 it works in Azure. As mentioned in my previous comments this happens before going to the STS so it doesn't seem like an Azure AD issue. Seems like an important issue to solve before people try to use it in production. more that it works on debug |
and if I literally just revert back to .NET 5 it works |
To Validate it wasn't a problem with something in my existing Azure web app I even created a new web app that has only been .net 6 and it doesn't work https://testnet2.azurewebsites.net/ for this I created a different branch and updated to .net 6 https://github.com/coding-flamingo/BlazorWasmWithAADAuth/tree/net6 so now I have both running side to side with literally the only change is updating to .net 6 |
Update this can be "Fixed" by adding the following to the Client .csproj file :
I will be removing my Azure test environments, but will leave this issue open since this is just a workaround until Microsoft fixes the issue... thanks to u/RoderoDaVinci for finding this fix. |
We believe this has been addressed in 7.0 as part of #43954. The fix should be available in RC2. |
Describe the bug
When deployed to Azure Web app with the preview version of .NET 6, the login button stops working and automatically redirects you to YOURSITE/authentication/login-failed. I looked in the logs and browser debug tools and couldn't see an error occurring anywhere. When running the code in localhost there is no problem.
To Reproduce
You can repro de issue live by going to https://sshmantest.azurewebsites.net/ and clicking login in the top right.
I have also created a repo with code and it includes the GitHub Action I am using to deploy the code to Azure:
https://github.com/coding-flamingo/BlazorWasmWithAADAuth
The Azure environment is an Azure Web App in a Linux app plan.

App plan:
Web App Configuration

Exceptions (if any)
No Exceptions were found
Further technical details
EDIT: To prove that it works on .net 5 five I moved the .NET 6 app to https://testnet2.azurewebsites.net/ and the working .NET 5 is now in https://sshmantest.azurewebsites.net/
The text was updated successfully, but these errors were encountered: