Skip to content

Blazor and multiple auth providers #15033

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

Closed
aL3891 opened this issue Oct 11, 2019 — with docs.microsoft.com · 1 comment · Fixed by #18665
Closed

Blazor and multiple auth providers #15033

aL3891 opened this issue Oct 11, 2019 — with docs.microsoft.com · 1 comment · Fixed by #18665
Labels
Blazor doc-enhancement Pri3 Source - Docs.ms Docs Customer feedback via GitHub Issue

Comments

Copy link
Contributor

aL3891 commented Oct 11, 2019

I was have some issues getting blazor to work in a solution with multiple auth middleware like AzureAD and AzureADBearer and the problem was that i needed to add an Authorize with AuthenticationSchemes set.

This however can only be done globally since that property can't be specified on the Component level. Instead as, per the discussion below, i can call endpoints.MapBlazorHub().RequireAuthorization(new AuthorizeAttribute { AuthenticationSchemes = AzureADDefaults.AuthenticationScheme }); but that is not documented on this page.

I think it would be good to add because blazor is probably going to be used for a lot of back office apps where people want to ensure there is no unauthenticated access

The issue where this discussion was has is dotnet/aspnetcore#14916


Document Details

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blazor doc-enhancement Pri3 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