-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blazor - Wasm pre-rendering (without server interactivity) - MSAL Auth on client side only not working #58833
Comments
Yes! if you're referring to a hosted WASM scenario. The idea was that devs would start building Blazor Web Apps and eventually move hosted WASM apps to BWAs. Based on how your discussion goes here, I'll open an docs issue if we need to provide additional coverage. I won't be surprised if they say that that's an unsupported scenario at this time. |
That would be a 'super' regression. I mean, this worked back in .net 5 ( I had it working in previous projects), and the issues seems to be only in the Auth. the rest seems to work fine. |
For more context, this is how it worked previously: |
Thanks for contacting us. First and foremost, if you want to have prerendering support, that means you also have to think about supporting authentication on the server, as prerendering happens on the server. If you'd like to support auth only on the client, you will have to disable prerendering. |
@michelkommers ... I'm going to make a tracking item entry to look at this for coverage at a strategic spot in the Security and Identity overview article, and it will at least be cross-linked from the Prerendering article. |
BTW ... I noticed that I did version-out the coverage at ... ... when BWA/8.0 arrived. I'll work a section back into the docs on this subject per my tracking item. I might reach that soon, but things are a bit crazy at the moment with 9.0 coming out. I'll get to it ASAP 🏃♂🏃♂🏃♂🏃♂. |
@guardrex and @mkArtakMSFT I actually got it working after spending a few hours dealing with 'bug after bug'. The main thing is.... I had to make 'fake' services in the server program.cs, after that I excluded the page 'authentication/xxx' from being pre-rendered due to the 'RemoteAuthenticatorView'. I will do further tests tomorrow to make sure everything is working nicely, but let me know if a sample would help the docs etc. |
I don't think that they'll want to cover a workaround approach, but I'm 👂 if they do. |
This issue has been resolved and has not had any activity for 1 day. It will be closed for housekeeping purposes. See our Issue Management Policies for more information. |
Is there an existing issue for this?
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
The text was updated successfully, but these errors were encountered: