Skip to content

Blazor - Wasm pre-rendering (without server interactivity) - MSAL Auth on client side only not working #58833

Closed
@michelkommers

Description

@michelkommers

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I am struggling with setting up a Wasm + SSR (ExcludeFromInteractiveRouting) + prerender + Client Side MSAL Auth with AD B2C ( without Blazor server interactivity).

In other words, a setup that runs on wasm only and is pre-rendered in SSR without auth working, but the auth must work on the client side only, so we can refresh tokens and etc etc without depending on the server side.

Right now, the issue seems that it never uses msal and tries to use the server side or gives error while attempting to convert one auth provider to other etc... this worked back in .net 5 with a super odd setup that i tried to put in .net 8 but doesn't work, tested with .net 9 RC 2 and same thing.

Can you provide a guide for this setup using .net 9?

Putting @guardrex because I didn't find that setup in any docs (and it was previously supported in .net 5 I think, and it seems that the docs that covered that were removed)

Expected Behavior

A setup to make wasm pre-rendering work without auth on the server (SSR) but working on the client with MSAL, without using server interactivity.

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✔️ Resolution: AnsweredResolved because the question asked by the original author has been answered.Status: Resolvedarea-blazorIncludes: Blazor, Razor Componentsfeature-blazor-msalThis issue is related to MSAL usage in Blazor

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions