Skip to content

.NET 8 preview7 Blazor WASM AAD authentication ends with There was an error trying to log you in: '"undefined" is not valid JSON' #49956

Closed
@haslingerm

Description

@haslingerm

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I am getting the same issue as described in #44981 again: after coming back from login at Azure AD the user sees 'There was an error trying to log you in: '"undefined" is not valid JSON'' at the 'authentication/login-failed' route.

However, after manually navigating around the token is available so it kind-of worked anyway.

Same as with the previous issue, adding the following solves the issue, so I suspect a similar cause:

<ItemGroup>
    <TrimmerRootAssembly Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" />
</ItemGroup>

Also: error does not appear during development, only after publish also pointing to the linker

Expected Behavior

No error should be displayed after the redirect if the operation was successful.

Steps To Reproduce

Standard Blazor WASM application using Microsoft.Authentication.WebAssembly.Msal (8.0.0-preview.7.23375.9), set up to use 'redirect' and not the 'pop up' auth option.

Exceptions (if any)

No response

.NET Version

8.0.100-preview.7.23376.3

Anything else?

No response

Metadata

Metadata

Assignees

Labels

Pillar: Technical Debtarea-blazorIncludes: Blazor, Razor ComponentsbugThis issue describes a behavior which is not expected - a bug.feature-blazor-wasmThis issue is related to and / or impacts Blazor WebAssembly

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions