I face difficulties to use Microsoft Entra External ID to authenticate a Blazor Web App

NIKOS EFENTAKIS 0 Reputation points
2025-02-22T17:49:43.8+00:00

I tried both example code: Azure-Samples/ ms-identity-ciam-dotnet-tutorial

and dotnet/ blazor-samples

I cannot run the samples in .Net 9.

I have managed to login succesfully (I get an annoying error message, but it does not throw an error: Could not read source map for https://aadcdn.msftauth.net/shared/1.0/content/js/oneDs_f2e0f4a029670f10d892.js: Unexpected 404 response from https://aadcdn.msftauth.net/shared/1.0/content/js/oneDs_f2e0f4a029670f10d892.js.map:

BUT I cannot logout!

I place a link: <a href="MicrosoftIdentity/Account/SignOut">Logout</a>

and when I hit it I get the following exception:

TypeError: The provided value cannot be converted to a sequence.

Stack trace:

> at Object._oX (https://logincdn.msauth.net/16.000/content/js/MeControl_yl3C2NknpDMsGqlCvzLtmA2.js:1:15546)

> at https://logincdn.msauth.net/16.000/content/js/MeControl_yl3C2NknpDMsGqlCvzLtmA2.js:1:15195

I made the following adaptations:

  1. appsettings.json:
        "Domain": "azureefce.onmicrosoft.com",
    
        "TenantId": "a73...-54ff1faab232",
    
        "ClientId": "09e...1dab20",
    
        "CallbackPath": "/signin-oidc",
    
         "Instance": "https://a73...232.ciamlogin.com/",
    
        "ResponseType": "code"
    
  2. In App Registration I used mobile and desktop profile with url: https://localhost/signin-oidc

All other options failed (i.e. SPA or Web)

Can anyone help?

Microsoft Entra External ID
Microsoft Entra External ID
A modern identity solution for securing access to customer, citizen and partner-facing apps and services. It is the converged platform of Azure AD External Identities B2B and B2C. Replaces Azure Active Directory External Identities.
3,046 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.