Skip to content
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

Add Blazor hosted WASM prerendering steps when using Azure Ad authentication #23441

Closed
Markz878 opened this issue Oct 3, 2021 · 1 comment · Fixed by #23442
Closed

Add Blazor hosted WASM prerendering steps when using Azure Ad authentication #23441

Markz878 opened this issue Oct 3, 2021 · 1 comment · Fixed by #23442
Assignees
Labels
Blazor Source - Docs.ms Docs Customer feedback via GitHub Issue

Comments

@Markz878
Copy link

Markz878 commented Oct 3, 2021

Please create documentation that shows the steps to use Blazor Hosted prerendering when using Azure Ad authentication. Currently the error page says that it can't get CascadingAuthenticationState cascading parameter. If I copy the builder.Services.AddMsalAuthentication(options =>
{
builder.Configuration.Bind("AzureAd", options.ProviderOptions.Authentication);
options.ProviderOptions.DefaultAccessTokenScopes.Add("scope_uri");
});
the error page says that it can't perform JS interop during server-side prerendering.
My index page does not even require authorization.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@dotnet-bot dotnet-bot added Blazor Source - Docs.ms Docs Customer feedback via GitHub Issue labels Oct 3, 2021
@guardrex guardrex self-assigned this Oct 3, 2021
@guardrex
Copy link
Collaborator

guardrex commented Oct 3, 2021

Hello @Markz878 ... It isn't supported. See the Support prerendering with authentication section of ...

https://docs.microsoft.com/en-us/aspnet/core/blazor/security/webassembly/additional-scenarios?view=aspnetcore-5.0#support-prerendering-with-authentication-1

... which is cross-linked in the Prerendering topic at ...

https://docs.microsoft.com/en-us/aspnet/core/blazor/components/prerendering-and-integration?view=aspnetcore-6.0&pivots=webassembly#additional-blazor-webassembly-resources

I'll add a cross-link to that to the WASM Security Overview topic as well. What I might do in the end is make an INCLUDE file out of that section and place a copy of the entire section in both the Security Additional Scenarios doc and this Prerendering and Integration doc. I'll make a note to myself to check on doing that when I reach that topic for more work later. Thanks for commenting on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blazor Source - Docs.ms Docs Customer feedback via GitHub Issue
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants