How to implement role based authorization in Blazor Server apps

preview_player
Показать описание
Role based authorization is a very common application requirement, but how to implement it in Blazor Server apps? We got you covered, as in this video we demonstrate how to add role based authorization to your Blazor Server apps.
#Blazor #AspNetCore #DotNetCore

Chapters
1. Intro: 00:00
2. Adding role services: 02:05
3. Setting up the UI: 03:59
4. Adding roles and assigning to users: 05"31
5. How roles are set up in DB: 08:56
6. Working with Roles in AuthorizeView: 10:44
7. Working with roles via policies: 13:33
Рекомендации по теме
Комментарии
Автор

Fantastic series on authentication, cheers!

RomanNorman
Автор

Great series, it's the only good one I have found on YouTube. Keep up the great work!
Edit: you should do a video about 3rd party authentication like Google, Microsoft, Facebook, etc.

jacobangel
Автор

please continue this series with password reset and claim/policy setup edit/update

mrt
Автор

Wonderful explanation!! I've been able to implement it so smoothly. Thank you

felipeabajo
Автор

Great tutorial. I have a couple questions though.
First, is it possible to use a mixture of Identity and AD authorization? In the previous video's comments you give an example of how to add a claim for an AD group but what if the users are placed in the Identity tables and the Admins are in the AD. Was thinking about checking if the user is in the AD group then adding as a user with the claim and role of admin but if there is a more efficient way that would be better. Basically, is it possible to add the AD group as a role instead of a claim for the AD group or would it be better to have 1 role with several user claims and an admin claim .
Second, in a couple of the videos you mention that in the next video you will show how to do the links for login and logout but never do. This would be easy to see if the code was available but I do understand. However would like to know how that is done as well as some of the other features you had not discussed like email confirmation, user lockout, forgot password and other more authorization features.
Third, when you added a role and claim there was no check to see if the role or claim already existed. Wouldn't that throw an exception? What is the best way to handle that?
Thank you for your time and effort.

eagleusa
Автор

HOw would i make it so i can make already registered users an admin instead of making it on create account?

Jabby
Автор

Great job always. Only challenge is, nowhere to download the code/sample projects. You think you can make those available?

superbchannel
Автор

If we have a Blazor server app (eg. an Intranet) that runs in Lan with Windows Authentication and you want to add Roles based Authorization, is it possible to use all the Microsoft.AspNetCore.Identity features (RoleManager, IdentityRole, AuthorizeView with Roles, etc.)?

With custom tables (eg. Employee with domainAccount as PK, Roles, EmployeesRoles) or you must implement the aspnet* tables and have an IdentityDataContext?

sandroriz
Автор

How about a video on how to get windows authentication back? How would I get AD role based security to work in a blazor 8 server app ? MS really screwed that right into the ground in Blazor 8.
running on IIS I cant even gtet the currently logged in user.

bgrant