Role Based Authorization With Identity and ASP.NET Core Web API

preview_player
Показать описание

Hi guys. I’m Marinko Spasojevic and in this video, I will talk about using Roles in Web API authentication with Identity. I already covered the registration and the authentication flow, and now, you will see how Roles fit into the story.

So, you will see how to support roles in our app, how to extend the default IdentityRole class so you can modify the AspNetRoles table with some additional columns, and how to modify already implemented registration and authentication logic to support roles as well.

LINKS MENTIONED IN THE VIDEO

FOLLOW US ON SOCIAL MEDIA!
Рекомендации по теме
Комментарии
Автор

Thank you all for watching and for your support.

CodeMaze
Автор

Thanks a lot for the video
I hope you take about Permissions and Access Control

Tamer_Ali
Автор

Also, can you please make a video on dynamic roles for role based authorization and how to mapped that dynamic role value in the controller method?

anilanandachakrabortty
Автор

I am using VS 2022. I opened the PMC and entered: "Add-migration IdentityRoles"
.
The PMC displayed the following error:

The INSERT statement conflicted with the FOREIGN KEY constraint The conflict occurred in database "IdentityYT", table "dbo.AspNetUsers", column 'Id'.
The statement has been terminated.

I inspected the ASP tables created by the migration. The AspRoles table has two roles (Visitor and Admin).

None of the other ASP tables have any data.

What am I missing?

Thank you for your help

philipquarles