Skip to content

Blazor WASM "Error trying to log you in" on Net 5 and 6 in VS 2022 #39201

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

Open
1 task done
dochoss opened this issue Dec 27, 2021 · 9 comments
Open
1 task done

Blazor WASM "Error trying to log you in" on Net 5 and 6 in VS 2022 #39201

dochoss opened this issue Dec 27, 2021 · 9 comments
Labels
area-blazor Includes: Blazor, Razor Components feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly feature-blazor-wasm-auth investigate
Milestone

Comments

@dochoss
Copy link

dochoss commented Dec 27, 2021

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When creating a new Blazor WASM project with authentication set to "Microsoft Identity Platform", with HTTPS checked, and with and without PWA checked (both tested), login fails with "There was an error trying to log you in: '' ". I've seen the other errors posted that include a "toLowerCase" related error, but this error doesn't show that. I'm getting a 400 - Bad Request error when calling the token endpoint during the login process (https://login.microsoftonline.com/<my tenant id>/oauth2/v2.0/token).

The only change I made to the default project file is to add Azure AD info to the appsettings.json file in wwwroot. I've tried with .Net 5 and 6 in the latest versions, and made sure to update VS 2022 to the latest version. I've tried cleaning out the bin and obj folders multiple times, and have tried multiple browsers (Edge, Chrome, and Brave). I saw on other posts the workaround of excluding the auth package from trimming (as here: #37206 (comment)) but that didn't have any effect.

In my local network, I have a Pi-Hole for ad filtering, but login.microsoftonline.com is whitelisted, and I've tried logging in to the Blazor app with Pi-Hole totally disabled and that has the same result as above. Other than Pi-Hole, I have nothing between my machine and the internet.

Repro repo is here: https://github.com/dochoss/blazor-wasm-login-error.git

Expected Behavior

User logs in successfully

Steps To Reproduce

  1. Clone repo
  2. Update AzureAd object in appsettings.json
  3. Run
  4. Attempt to log in

Exceptions (if any)

I see this in the Output window in VS 2022:

The program '[35560] dotnet.exe' has exited with code 4294967295 (0xffffffff).

.NET Version

6.0.101

Anything else?

VS Community 2022 v17.0.4

Results of dotnet --info:

.NET SDK (reflecting any global.json):
 Version:   6.0.101
 Commit:    ef49f6213a

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19042
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\6.0.101\

Host (useful for support):
  Version: 6.0.1
  Commit:  3a25a7f1cc

.NET SDKs installed:
  3.1.101 [C:\Program Files\dotnet\sdk]
  3.1.200 [C:\Program Files\dotnet\sdk]
  3.1.201 [C:\Program Files\dotnet\sdk]
  3.1.402 [C:\Program Files\dotnet\sdk]
  5.0.100-rc.1.20452.10 [C:\Program Files\dotnet\sdk]
  5.0.201 [C:\Program Files\dotnet\sdk]
  5.0.400 [C:\Program Files\dotnet\sdk]
  6.0.101 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.All 2.1.29 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.29 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.18 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.0-rc.1.20451.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.29 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.18 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.0-rc.1.20451.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.18 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.0-rc.1.20452.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET runtimes or SDKs:
  https://aka.ms/dotnet-download
@pranavkm pranavkm added the area-blazor Includes: Blazor, Razor Components label Dec 27, 2021
@pranavkm
Copy link
Contributor

Could you include the logs from the browser Developer console?

@pranavkm pranavkm added the Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. label Dec 27, 2021
@ghost
Copy link

ghost commented Dec 27, 2021

Hi @dochoss. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@dochoss
Copy link
Author

dochoss commented Dec 28, 2021

HAR file from dev console attached. Let me know what else I can provide.

Scholar-LoginProcess-BlazorWASM.zip

@ghost ghost added Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. and removed Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. labels Dec 28, 2021
@pranavkm
Copy link
Contributor

@dochoss sorry I didn't mean the network log. The developer console will typically include logs or exception stack traces, if any. Is it entirely empty?

@dochoss
Copy link
Author

dochoss commented Dec 29, 2021

Sorry, no, there is no other information in the console.

@mkArtakMSFT mkArtakMSFT removed the Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. label Jan 3, 2022
@javiercn javiercn added feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly feature-blazor-wasm-auth labels Jan 10, 2022
@mkArtakMSFT
Copy link
Contributor

Thanks for additional details, @dochoss.
We know it's hard to investigate such issues and have created this issue to try to improve that area.

@mkArtakMSFT mkArtakMSFT added this to the Backlog milestone Jan 10, 2022
@ghost
Copy link

ghost commented Jan 10, 2022

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.

@dochoss
Copy link
Author

dochoss commented Jan 11, 2022

@mkArtakMSFT Thanks for letting me know. I really want to love Blazor, as I'm mostly a C# dev, I just keep running into frustrating issues like this when spinning up new projects. I built my first Blazor app on version 0.1, so I've seen it mature and I'm still very excited about its future! I'll keep following and trying whenever new projects crop up. Thanks to you and the team for your work!

@ghost
Copy link

ghost commented Dec 5, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly feature-blazor-wasm-auth investigate
Projects
None yet
Development

No branches or pull requests

5 participants