Role based Authorization in ASP.NET CORE

preview_player
Показать описание
In this ASP.NET CORE Video Tutorial, I will show you, How to set roles in ASP.NET CORE Using Identity Database. How to restrict user for accessing certain action method of controller section.

I used Authorize attribute with roles parameter. In this tutorial i have used many class like
1. RoleManager class
2. identityRole class
3. UserManager class

I will make a video on Claim based authorization as well as Policy based authorization in ASP.NET Core.
Рекомендации по теме
Комментарии
Автор

Thanks for sharing. I have successfully created User Role login UI based.

SandeepKumar-kvvj
Автор

please make the incomplete part complete .. what tables you used for register in database. make it clear

ishraturmi
Автор

It was fantastic, I've a question how did you inject RoleManager<IdentityRole> roleManager instance into configure method? how it'll get that values?

fkamss
Автор

Why Amit not Admin? How You add users to role? How you change role to user? U did not show main idea. Maybe you can add PART video?

borisvainrub
Автор

can you make a video on error of object reference not set to instance of an object in visual studio 2017 asp.net core please ...

harirajanala
Автор

thanks but that method is not active in ver 2.1

lebuiminhnhan
Автор

Could you please make tutorial for how to assign roles to users. By the way it was a perfect tutorial.

ozzpro
Автор

Hi, I tried to add Roles to a .NET Core 2.0, following your instructions. The first part to add the Admin Role for the first logged-in User works; however, during part two, adding the Initializer class into the Startup.cs file failed with the following error. Can you please provide steps to add the initializer code into the program.cs, which is the recommended approach for .NET Core 2.0?

Exception has occurred:
An exception of type occurred in System.Private.CoreLib.dll but was not handled in user code: 'Object reference not set to an instance of an object.'
at Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.DatabaseErrorPageMiddleware.System.IObserver<System.Collections.Generic.KeyValuePair<System.String, System.Object>>.OnNext(KeyValuePair`2 keyValuePair)
at name, Object value)
at diagnostics, Type contextType, Exception exception)
at
at
at task)
at
at
at
at task)
at
at in 12
at
at task)
at in 68

webzest
Автор

hello sir how to redirect from login page to under Area index page

jitendrakumarsonkar
Автор

How to you identify role during login and redirect them to different page based on their role?

yirgahagos
Автор

Hi, It is Good, is it Possible to Provide This Project to me?

raghuramireddymandadi
Автор

Can I have a source code from this tutorial?

joaomendes
Автор

can you provide the source code kindly?

ishraturmi