question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Blazor Wasm AAD B2C authentication issue

See original GitHub issue

Describe the bug

Hi, I am struggling with the below error. Can’t figure out the root cause. I have a Blazor Wasm application with AAD B2C authentication. Login works fine, but after some time I get the below error. Any ideas what could be the problem?

image

Based on the console logs, it seems that ID token is undefined.

ClientAuthError: null_or_empty_id_token: The idToken is null or empty. Please review the trace to determine the root cause. Raw ID Token Value: undefined

Further technical details

  • Dotnet version: 5.0.100
  • Project dependencies

` <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="5.0.1" />

<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="5.0.1" PrivateAssets="all" />

<PackageReference Include="Microsoft.Authentication.WebAssembly.Msal" Version="5.0.1" />

<PackageReference Include="Microsoft.Extensions.Logging.Configuration" Version="5.0.0" />

<PackageReference Include="System.Net.Http.Json" Version="5.0.0" />

`

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
juho-hanhimakicommented, Jan 12, 2021

I did manually build a updated version of AuthenticationService.js which included patch https://github.com/dotnet/aspnetcore/pull/28498 AND updated the msal-browser library to 2.8.0 (https://github.com/dotnet/aspnetcore/issues/29010) (required some changes in the typescript source, but somehow got it working 😅).

Now the issue is gone for me. Don’t know which one of those two things fixed the issue, but the main thing for me is that the issue seems to be gone with those steps.

0reactions
ismailhozzacommented, Jan 13, 2021

Hi, I think this issue is resolved for me also. I did several changes, so I am not sure which one possibly fixed the issue. I updated the dependencies like @juho-hanhimaki and added couple of scopes (openid and offline_access) to the authentication config. So, I guess it can be closed for now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Secure a hosted ASP.NET Core Blazor WebAssembly app ...
This article explains how to create a hosted Blazor WebAssembly solution that uses Azure Active Directory (AAD) B2C for authentication.
Read more >
Secure an ASP.NET Core Blazor WebAssembly ...
This article explains how to create a standalone Blazor WebAssembly app that uses Azure Active Directory (AAD) B2C for authentication.
Read more >
AuthN-ing Blazor WASM with Azure AD B2C
Throughout this post, I'm going to walk through how to integrate Azure AD B2C with Blazor WASM (standalone) app.
Read more >
Problem with AzureB2C showing localhost login when ...
I have just completed a new Client-side Blazor app with Server, using Azure B2C for auth. Everything works perfectly on localhost, but when...
Read more >
Creating A Blazor WebAssembly Azure B2C Application
You can authenticate the users in your Blazor Client (WebAssembly) .NET Core 6 application (and even manage your users) using Azure Active ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found