Skip to content

Blazor WASM crashes with certain Azure B2C configuration #20706

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

Closed
adamasmar opened this issue Apr 9, 2020 · 8 comments
Closed

Blazor WASM crashes with certain Azure B2C configuration #20706

adamasmar opened this issue Apr 9, 2020 · 8 comments
Assignees
Labels
area-blazor Includes: Blazor, Razor Components feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly Validation This issue is used to track validation efforts

Comments

@adamasmar
Copy link
Member

adamasmar commented Apr 9, 2020

Describe the bug

Blazor WASM hard crashes when attempting to login using Federated Azure Active Directory account. The application's B2C integration was set up using this guide. It seems as if it may be related to issues reported here, but its not conclusive.

It appears the following is returning null:
var tokenResult = await AuthenticationService.RequestAccessToken();
if (tokenResult.TryGetToken(out var token)) {}
Upon @javiercn's suggestion, I've narrowed it down to the out var token returning null. Seems possibly related to this.

To Reproduce

  1. Complete steps outlined here
  2. Assure B2C users include Federated AD users and normal AD users
  3. Debug server application
  4. Login with a federated AD User
  5. Click on Fetch Data
  6. Note the browser crashes and debugging ceases with the following output:
>>>mono_wasm_get_loaded_files
The program 'javascript debugger root session' has exited with code -1 (0xffffffff).
The program '' has exited with code -1 (0xffffffff).
The program 'localhost:44363' has exited with code -1 (0xffffffff).
The program '[27544] iisexpress.exe' has exited with code -1 (0xffffffff).
Further technical details
  • Visual Studio16.6.0 Preview 2.1
  • Google Chrome Version 80.0.3987.163 (Official Build) (64-bit)
.NET Core SDK (reflecting any global.json):
 Version:   3.1.300-preview-015048
 Commit:    13f19b4682

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.18363
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\3.1.300-preview-015048\

Host (useful for support):
  Version: 3.1.3
  Commit:  4a9f85e9f8

.NET Core SDKs installed:
  3.1.100 [C:\Program Files\dotnet\sdk]
  3.1.101 [C:\Program Files\dotnet\sdk]
  3.1.200-preview-014883 [C:\Program Files\dotnet\sdk]
  3.1.201 [C:\Program Files\dotnet\sdk]
  3.1.300-preview-015048 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.0 [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.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.0 [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.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
cc: @guardrex
@javiercn
Copy link
Member

javiercn commented Apr 9, 2020

@adamasmar thanks for contacting us. This is an issue in the mono debugger proxy. I believe it is fixed already or will be soon.

@javiercn javiercn added area-blazor Includes: Blazor, Razor Components feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly labels Apr 9, 2020
@javiercn
Copy link
Member

javiercn commented Apr 9, 2020

If you run the app without debugging (CTRL+F5) it should work properly.

@adamasmar
Copy link
Member Author

adamasmar commented Apr 9, 2020

@javiercn, thanks. I am now able to run the application without a hard crash. However, I am still encountering a null reference exception for what I assume is AuthenticationService.RequestAccessToken().
if (tokenResult.TryGetToken(out var token)) {}

@adamasmar
Copy link
Member Author

So I am thoroughly confused. Loaded it this morning and it is working. Did not change anything in the code. The only thing was that the server (my dev computer) was restarted overnight. Looks like someone had a similar mysterious event here. I guess I will keep an eye on this?

@javiercn
Copy link
Member

it's debug/vs non debug.

WRT to your exception, that is a known issue that was addressed recently, update to the latest preview and try again.

@adamasmar
Copy link
Member Author

@javiercn, just clarify -- the latest Blazor Preview or the latest Visual Studio preview?

@javiercn
Copy link
Member

Latest blazor preview, but I'm not sure if it made it into preview3.

@adamasmar
Copy link
Member Author

Gotcha. I'm on Blazor version 3.2.0-preview3.20168.3 for what it is worth.

And in a further plot twist, when I debug the same server application within Visual Studio 16.4.3, I don't have any issues. It seems to only be occurring when I debug the server application on Version 16.6.0 Preview 2.1.

@mkArtakMSFT mkArtakMSFT added the Validation This issue is used to track validation efforts label Apr 14, 2020
@mkArtakMSFT mkArtakMSFT added this to the blazor-wasm-3.2-preview5 milestone Apr 14, 2020
@ghost ghost locked as resolved and limited conversation to collaborators May 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly Validation This issue is used to track validation efforts
Projects
None yet
Development

No branches or pull requests

3 participants