Blazor Wasm AAD B2C authentication issue
See original GitHub issueDescribe 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?
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:
- Created 3 years ago
- Reactions:2
- Comments:9 (5 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
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.