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

  Рет қаралды 2,890

Code Maze

Code Maze

Күн бұрын

Пікірлер: 14
@CodeMaze
@CodeMaze 5 ай бұрын
Thank you all for watching and for your support. ►► If you want to master Web API development using best practices, check out our Web API book: bit.ly/3x75ZMM ►► Also, to build great full-stack apps with Blazor, check out our course: bit.ly/3Pw3Y33
@РоманКозакевич-х3э
@РоманКозакевич-х3э 3 ай бұрын
Найкращий!! Дякую вам і Слава Україні !
@CodeMaze
@CodeMaze 3 ай бұрын
I am glad you find the video helpful.
@10Totti
@10Totti 5 ай бұрын
Another best Tutorial! Thanks!
@CodeMaze
@CodeMaze 5 ай бұрын
You're welcome! Thank for watching this one.
@Tamer_Ali
@Tamer_Ali 5 ай бұрын
Thanks a lot for the video I hope you take about Permissions and Access Control
@CodeMaze
@CodeMaze 5 ай бұрын
Thanks for the suggestion and watching the video.
@ugochukwuumerie6378
@ugochukwuumerie6378 5 ай бұрын
I second that too 👌🏼
@shahryarsaljoughi6073
@shahryarsaljoughi6073 3 ай бұрын
Thank you, perfect as always. It would be good if you could elaborate more on Role required properties as you initialized them. The original source code of RoleManager does a bit of complex logic for validation before setting those properties. I'm afraid I may break something if i use the constructor in despite of the common usage of RoleManager for creating roles. Is it possible to inject and use the RoleManager within the entity configuration?
@CodeMaze
@CodeMaze 3 ай бұрын
Hi. Thanks for the kind words. To be honest, I never dived deep into the implementation - I love the abstraction as is :) It is a service, and can be injected as a service inside any class. Now, I didn't need it inside the entity configuration class, so you have to try that.
@anilanandachakrabortty1416
@anilanandachakrabortty1416 5 ай бұрын
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?
@CodeMaze
@CodeMaze 5 ай бұрын
Interesting suggestion. I will see what I can do about that. Thanks for that.
@philipquarles4679
@philipquarles4679 4 ай бұрын
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 "FK_AspNetUserRoles_AspNetUsers_UserId". 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
@CodeMaze
@CodeMaze 4 ай бұрын
I am not sure, but based on the error message it means that you have users with different Ids, maybe in migratin files, and EF Core can't refernce those tables using FKs. Probably the UserRolePopulated migration file is trying to insert different user ids. Maybe, as you said, you don't have any users created, so you need to create one and use the id inside the UserROlePOpulated migration script. This is my solution based on the migration scripts I provided with the source code.
ASP.NET Core JWT Authentication and role-based authorization
39:17
БУ, ИСПУГАЛСЯ?? #shorts
00:22
Паша Осадчий
Рет қаралды 1,5 МЛН
Which team will win? Team Joy or Team Gumball?! 🤔
00:29
BigSchool
Рет қаралды 15 МЛН
ТЫ В ДЕТСТВЕ КОГДА ВЫПАЛ ЗУБ😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 3 МЛН
When u fight over the armrest
00:41
Adam W
Рет қаралды 23 МЛН
Authorization in ASP .NET Core Web API with Identity | .Net 8
45:53
DotNet Real world example
Рет қаралды 3,1 М.
Onion Architecture with .Net
20:24
MagwaiTech: Programming & Hacking with Abram
Рет қаралды 278
ASP NET Core role based authorization
8:25
kudvenkat
Рет қаралды 113 М.
Role-Based Authentication in ASP.NET Web API | ASP.NET Web API 🔥🔥
41:45
Satyarth Programming Hub
Рет қаралды 11 М.
БУ, ИСПУГАЛСЯ?? #shorts
00:22
Паша Осадчий
Рет қаралды 1,5 МЛН