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

Permission Based Authorization In Blazor .Net 8 #31485

Closed
MahdiElahi opened this issue Jan 15, 2024 · 2 comments
Closed

Permission Based Authorization In Blazor .Net 8 #31485

MahdiElahi opened this issue Jan 15, 2024 · 2 comments

Comments

@MahdiElahi
Copy link

MahdiElahi commented Jan 15, 2024

Hi ,
i want tutorial for permission based authorization with identity for .net blazor 8 ?
and tutorial for dynamic permission based

@javiercn javiercn transferred this issue from dotnet/aspnetcore Jan 17, 2024
@Rick-Anderson
Copy link
Contributor

cc @guardrex

@guardrex
Copy link
Collaborator

guardrex commented Jan 17, 2024

Hello @MahdiElahi ... At this time, we only have ...

https://github.com/dotnet/blazor-samples/tree/main/8.0/BlazorWebAppOidc

... which is an OIDC-based app. It doesn't rely on Entra-based packages or Microsoft Identity platform, but it can be used with Entra. There's no article to go with it yet, but that work is tracked by #31265. I'll get to it as soon as I can.

If you're looking for something that uses Microsoft Identity platform, any of the ASP.NET Core/Azure tutorials should work generally, but I recommend that you adopt interactive SSR globally for the app. We might have one or more new tutorials specifically for Blazor Web Apps later, but I think it won't be until after .NET 9 releases in November, which really means not until 2025. The reason is that the product unit is still working on security scenarios for Blazor Web Apps, especially for Auto components. If you use a Blazor Web App today with an IdP like Entra, I think sticking with global interactive SSR (Interactive Server) rendering (set in the App component on the Routes component instance) is the most likely way to produce an app that will work well ...

<Routes @rendermode="InteractiveAuto" />

Also note that Identity Razor Pages pages of <8.0 have been replaced with Identity Razor components for >=8.0. If any tutorial you use for Razor Pages/MVC apps is focused on Identity pages, it won't match what you find if you scaffold Identity into the Blazor Web App, so just be prepared for that change.

The tutorial that we usually point to in the Azure docs is ...

https://learn.microsoft.com/entra/identity-platform/quickstart-web-app-aspnet-core-sign-in

Our coverage for Azure with ASP.NET Core starts at ...

https://learn.microsoft.com/aspnet/core/security/authentication/azure-active-directory/

... but if an OIDC-based app will work for your scenario and you don't mind not having an article to go with it at this time, you can try that BlazorWebAppOidc app that I cross-linked above and see if it will meet your needs.

@github-project-automation github-project-automation bot moved this from Triage to Done in Blazor.Docs Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

5 participants