Тёмный
No video :(

Policy-based Authorization in ASP.Net Core (with Custom Authorization Handler) 

DotNet Core Central
Подписаться 27 тыс.
Просмотров 25 тыс.
50% 1

Опубликовано:

 

21 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 43   
@justonegoodtrade
@justonegoodtrade 4 года назад
my friend, you saved my life with a current project. You're amazing
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
Glad I could help!
@nuwan099
@nuwan099 4 месяца назад
Great content! thank you!
@syneticsolutions344
@syneticsolutions344 Год назад
Great video, thanks!
@DotNetCoreCentral
@DotNetCoreCentral Год назад
Glad you liked it!
@xposedcadabiola.o111
@xposedcadabiola.o111 4 года назад
Excellent explanation. Thank you very much.
@DotNetCoreCentral
@DotNetCoreCentral 4 года назад
Thanks
@nickeax
@nickeax 2 года назад
Excellent lesson, thank you very much.
@DotNetCoreCentral
@DotNetCoreCentral 2 года назад
@Nick Fletcher, thanks for watching!
@muhammadeakub6793
@muhammadeakub6793 4 года назад
great works! Keep it up.
@DotNetCoreCentral
@DotNetCoreCentral 4 года назад
Muhammad Eakub thank you!
@johnnguyen1655
@johnnguyen1655 4 года назад
Very good tutorial on the subject. Thanks very much
@DotNetCoreCentral
@DotNetCoreCentral 4 года назад
@@johnnguyen1655 Thanks!
@saurabhchauhan232
@saurabhchauhan232 3 года назад
Suggestion: Video for when to use Transient, Scoped and Singleton would be really helpful. (on you realworld project experience :) )
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Saurabh Chauhan, thanks for watching, and thanks for the suggestion!
@elioscipioni8908
@elioscipioni8908 3 года назад
thanks for sharing, great video!!
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Elio Scipioni, thanks for watching!
@trinhnv1205
@trinhnv1205 3 года назад
very helpful
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Nguyễn Văn Trình, thanks for watching!
@giampaolotucci5897
@giampaolotucci5897 2 года назад
Really tnx
@DotNetCoreCentral
@DotNetCoreCentral 2 года назад
@Giampaolo TUCCI, thanks for watching!
@karenj5880
@karenj5880 3 года назад
Thank you!
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Karen D, thanks for watching!
@karenj5880
@karenj5880 3 года назад
@@DotNetCoreCentral It was very straight forward and to the point, answered exactly what I was looking for!
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@@karenj5880 glad this video could help!
@yogeswarank
@yogeswarank 3 года назад
Thank you very much. Can you also make a video on how to change the user claim after the user is logged in. Need a flexibility to refresh the claims of the user without asking him to log out and login again.
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@yoges waran, thanks for watching the video! If I understand your requirement correctly, what you are looking for is the refresh token implementation. I have done a video on the same here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-7JP7V59X1sk.html Please take a look and let me know if this serves your purpose.
@user-xw5qu2re4g
@user-xw5qu2re4g Год назад
can you kindly tell me how to write authorization handler to keep user with same role i.e. user from editing or deleting each others records
@ataaact9375
@ataaact9375 3 года назад
great vid. but unrelated question, what 's the name of the extension that you're using to get when the code was committed last and by whom?
@KunalMukherjee3701
@KunalMukherjee3701 3 года назад
It comes by default in visual studio pro and enterprise, it's called git blame
@ataaact9375
@ataaact9375 3 года назад
@@KunalMukherjee3701 aha that's why I don't have it, I use community. Thanks for the reply!
@yanchenru
@yanchenru 3 года назад
First of all, great video. Got a quick question, at 16:58, you replaced the previous policy "AdminAndPowerUser" with the new one "EmployeeWithMoreThan20Years". What if I want to keep the previous one as well, so a user who is an Admin but has worked less than 20 years can still have the access? Could you please help to explain how to implement that? Thanks very much.
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Chenru Yan, I am not 100% sure, I will have to try it out, but the easiest solution I can think of is creating a new policy to cover all the scenarios.
@yanchenru
@yanchenru 3 года назад
@@DotNetCoreCentral Thanks for your reply. For the new policy, does that mean a new handler will be created to check if the user belongs to Admin or PowerUser or has worked more than 20 years? That feels like repeating what already have been done in the other two policies. Just curious is possible in the Startup.cs file, do something such as options.AddPolicy("Combined", policy => policy.Add("AdminAndPowerUser", "EmployeeWithMoreThan20Years")); I am quite new to ASP.NET, please bear with all my naive questions.
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@@yanchenru This post in stack overflow should help you with your requirement: stackoverflow.com/questions/35609632/asp-net-5-authorize-against-two-or-more-policies-or-combined-policy
@yanchenru
@yanchenru 3 года назад
@@DotNetCoreCentral Thank you for the information, it is very helpful.
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@@yanchenru you are welcome!
@OsamaALSHABANi
@OsamaALSHABANi 3 года назад
good vide , but i have question , what if my Roles are created on the running of the Application , it should not be hard coded here specially when you are using RequireRole function
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Osama ALSHABANi, thanks for watching! For your question, roles are usually decided as part of the requirement gathering process, not so much as a part of runtime code. But if you have a scenario where roles are created dynamically, in that case, you cannot use it this way for sure.
@genotypek6133
@genotypek6133 2 года назад
My friend it's authorization not authentication. You can authenticate yourself with bearer token, cookie etc. - just to tell who you are. You can authorize yourself with policies or roles - check if you're allowed to do something.
@sav4384
@sav4384 2 года назад
how can we fetch roles from db and use in handler
@DotNetCoreCentral
@DotNetCoreCentral 2 года назад
@saveen gs, it should be just like any other place where you access the database. You do it from the middleware for authentication.
@sav4384
@sav4384 2 года назад
@@DotNetCoreCentral thankq
Далее
JWT Refresh Token in ASP.Net Core (a deep dive)
33:13
Authorization in ASP NET Core
12:27
Просмотров 166 тыс.
ASP.NET Core Authentication with Custom Handler
20:36
Role based Authorization in ASP.NET Core (.NET 7)
16:19
ASP.NET Core - Roles vs Claims vs Policy
23:11
Просмотров 98 тыс.