Skip to content

Blazor WASM AADB2C template fetchdata failed due to The issuer '(null)' is invalid #39401

@Alienroid

Description

@Alienroid

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Blazor WASM AADB2C template's fetchdata will fail after enter credentials. The error shows 401 Unauthorized in the console. Look at the requests. ID token and Access token were received with correct scp. The response header shows www-authenticate: Bearer error="invalid_token", error_description="The issuer '(null)' is invalid". However the issuer is present in the request and not null.

One thing I did observe, in the documentation
it shows: "iss": "https://mysiteb2c.b2clogin.com/5cc15ea8-a296-4aa3-97e4-226dcc9ad298/v2.0/",

however, the one I received in the id token is like:
"iss": "https://mysiteb2c.b2clogin.com/tfp/[guid]/b2c_1_signin_signup/v2.0/",

Expected Behavior

Able to access the data requested

Steps To Reproduce

  1. follow instructions from https://docs.microsoft.com/en-us/aspnet/core/blazor/security/webassembly/hosted-with-azure-active-directory-b2c?view=aspnetcore-6.0
  2. run the app
  3. click on Fetch Data
  4. enter credentials
  5. call will fail. inspect to see that it received 401 unauthorized. on network tab, it shows received both id token and access token. look at the request it shows response header: www-authenticate: Bearer error="invalid_token", error_description="The issuer '(null)' is invalid"

Exceptions (if any)

No response

.NET Version

6.0.0

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions