JWT Token with RBAC(Role-Based Access Control) in ASP.NET Core WebAPI

preview_player
Показать описание
Introduce how to do RBAC with JWT token in ASP.NET Core WebAPI for some real life application scenarios:

00:00 What is RBAC (Role based access control)
01:14 Protect resource to allow only a specific role
02:56 Adding role info to JWT token
04:12 Customize payload name for role info on JWT
05:01 Setup TokenValidationParameter to recognize alternative names for roles from the access token
06:17 Real scenario: allows a resource accessed by multiple roles
07:15 Real scenario: assigns multiple roles to a user

For more videos like this:

Source code FYI:
Рекомендации по теме
Комментарии
Автор

Great video as always, straight to the point without complicating things too much

christofferandersson
Автор

in case you're not hard coding the values for role claim, is it better to use "ClaimTypes.Role" claim ?
and i want to have multiple roles to be available only, for an example i only want owner and admin in my project,
in such case, what will be the best practice to it ?

_MoshikoAz_
Автор

What should I do if a user has more than one role?

beratak
visit shbcf.ru