Skip to content

Prerendering Blazor WASM .NET 5 app with authentication throws error #28025

@ChristianWeyer

Description

@ChristianWeyer

I have a Blazor WASM application using OIDC authentication (based on this https://docs.microsoft.com/en-us/aspnet/core/blazor/security/webassembly/standalone-with-authentication-library?view=aspnetcore-5.0&tabs=visual-studio). This works fine.

Now, when I add WASM prerendering (based on this https://docs.microsoft.com/en-us/aspnet/core/blazor/security/webassembly/additional-scenarios?view=aspnetcore-5.0#support-prerendering-with-authentication), then it no longer works. I get a strange behavior after the app loads and 404 errors. The redirect after the login then also hits a 404.
In fact, every route is giving a 404... hm...

image

Here is a small demo video:

BlazorDemo

This is the demo code:
https://github.com/thinktecture/blazor-webassembly-demo/tree/prerender

.cc @guardrex
dotnet/AspNetCore.Docs#20696

Metadata

Metadata

Assignees

Labels

✔️ Resolution: DuplicateResolved as a duplicate of another issuePriority:2Work that is important, but not critical for the releaseStatus: Resolvedaffected-mediumThis issue impacts approximately half of our customersarea-blazorIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing onefeature-blazor-wasmThis issue is related to and / or impacts Blazor WebAssemblyfeature-blazor-wasm-authfeature-prerenderingIssues related to prerendering blazor componentsseverity-blockingThis label is used by an internal tool

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions