Тёмный

ASP.NET Core Authorization (.NET 7 Minimal Apis C#) 

Raw Coding
Подписаться 73 тыс.
Просмотров 38 тыс.
50% 1

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

 

11 сен 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 79   
@unhandledexception1948
@unhandledexception1948 23 дня назад
I keep coming back to these basic walk throughts of the complex topic of authentication / authorization as really they are the best way I found to get my head wrapped around this topic
@lukedjuuuu
@lukedjuuuu 2 года назад
I've said it once and I'll say it a a hundred times, Anton has the best flow in telling dev stories
@frankbanini8884
@frankbanini8884 2 года назад
Lol😉
@michaelestrinone2111
@michaelestrinone2111 2 года назад
To say that your videos are a godsend is an understatement. Thank you!
@Felipehsbr
@Felipehsbr Год назад
First of all, thanks for that content. It's pure gold. I was coding along the tutorial, and got the InvalidOperationException when trying to call the SignInAsync method inside the login route, and I had the exact same code as Anton. If anyone else is getting the error, to fix that you have to pass the scheme in the ClaimsIdentity constructor: var identity = new ClaimsIdentity(claims, AuthScheme);
@albertbanaszek2024
@albertbanaszek2024 2 года назад
Very impressive as always. Short, easy to understand, only the essence.
@piotrc966
@piotrc966 2 года назад
Great! Please more about customization policy and handlers etc.
@johndoe4016qweasd
@johndoe4016qweasd 2 года назад
Cool stuff! Thank you for your efforts man!!!
@RawCoding
@RawCoding 2 года назад
Glad you liked it!
@emilrasmussen7429
@emilrasmussen7429 Год назад
As a dane, I was worried we weren't included, thank you for including! 😁
@avjvfx6484
@avjvfx6484 2 года назад
Wow, so well done! Thanks for posting, man! Very helpful.
@thanh8428
@thanh8428 Год назад
Great video, thanks for your explaination. It helps me understand a lot about asp.net core authentication because there isn't any document for detailed
@stoic2454
@stoic2454 10 месяцев назад
Your channel is gold mine!!!, thanx alot for amazing explanation.
@CanalExistencial
@CanalExistencial 6 дней назад
Thank you very much! Your content is really very helpful!
@TolgaKoseoglu
@TolgaKoseoglu Год назад
Another great video. Thank you, Anton!
@RawCoding
@RawCoding Год назад
again thank you)
@NoDoubt747
@NoDoubt747 8 месяцев назад
Great video. At 15:47 the video of you covers the code. This is very informative though, thank you for making it.
@roynilsson1382
@roynilsson1382 5 месяцев назад
Extremely good content. you're awesome!
@user-cc8kb
@user-cc8kb Год назад
Thanks a lot. Its a lot to digest, but its very well explained :)
@JinoLeGeek
@JinoLeGeek 22 дня назад
Amazing Job
@viniciusdemorais8074
@viniciusdemorais8074 Год назад
Thank youuu, U r simply the best. Helped me alot!!
@RawCoding
@RawCoding Год назад
Nice, thank you for watching!
@user-qf2xk1fg6e
@user-qf2xk1fg6e Год назад
Amazing as always! A lot of good info without bla bla bla.
@maksadnahibhoolna-wc2ef
@maksadnahibhoolna-wc2ef 11 месяцев назад
Man you really live up to your channel's name - "Raw anaylysis of concepts"
@rezarezash
@rezarezash Год назад
Thank you for the great content. You are a GEM
@yogendramaarisetty
@yogendramaarisetty 7 месяцев назад
Amazing Video!
@octaviandobre
@octaviandobre 2 года назад
Nice video!
@obaibasheer7108
@obaibasheer7108 Год назад
Very impressive , Thank you!
@victorchisomnwisu9776
@victorchisomnwisu9776 2 года назад
You are simply amazing
@evildoer1606
@evildoer1606 Год назад
We just don't deserve you! Thanks a lot!
@RawCoding
@RawCoding Год назад
Cheers, if you’d like to help me give the video a share )
@yazanshakhshir3049
@yazanshakhshir3049 Год назад
Thank you 😍🤩
@hkorasch
@hkorasch Год назад
Very good!
@youshasajjad5402
@youshasajjad5402 3 месяца назад
thank you
@caglarcansarikaya1550
@caglarcansarikaya1550 Год назад
Thank you!
@antonkoposov9858
@antonkoposov9858 7 месяцев назад
Hi, Anton. Thank you for your super usefull content. What do you think? I have some remote repository (web api) that provide permissions of authenticated user. Getting this permissions must be done in AuthenticationHandler or in AuthorizationPolicy when deciding if user allowed to have access to endpoint?
@crutz3064
@crutz3064 7 месяцев назад
If i authorize with the IISAuthorizationScheme against a local Ad on Windows, which claims will be filled in the user object? Can i influence the process of building the user object? Thank you so much.
@mumk
@mumk 10 месяцев назад
tq
@AngryBacteria
@AngryBacteria Год назад
How would this work in a production setup? A database with hashed passwords for login and then another table for their claims?
@TakuCoding
@TakuCoding 2 года назад
Thanks for the video, can you make Auth with vue, logging in, out and registering and navigation to endpoints based on claims, =)
@frankbanini8884
@frankbanini8884 2 года назад
Great video as always. Nice and slow.
@RawCoding
@RawCoding 2 года назад
Thank you for watching)
@DerekWelton
@DerekWelton Год назад
Lets say I have an ERP system and a user needs access to Contacts, Projects, inventory, Accounting, Leads, etc (each of those have read write update roles). This could lead to adding a lot of claims to the token. Is it ok to add many claims with their roles? Or would it be better to make another request to the Api to get the User's roles and permissions?
@RawCoding
@RawCoding Год назад
There are no problems with ether approach, it’s whatever makes sense, I’d say do the extra call.
@DerekWelton
@DerekWelton Год назад
@@RawCoding makes sense. This would also allow you to not depend on having control over the claims if you use a 3rd party Auth
@ivandrofly
@ivandrofly Год назад
thanks
@aydnbilgin1627
@aydnbilgin1627 2 года назад
any of them even if they all are bit similar. But I can tell few tNice tutorialngs changed and also I forgot almost everytNice tutorialng so I guess Im gonna start
@RawCoding
@RawCoding 2 года назад
Ty I guess?
@MeverikEgiami
@MeverikEgiami 7 месяцев назад
Do you have a double like option? =)
@rahulfunde1179
@rahulfunde1179 2 года назад
yes
@nullentrophy
@nullentrophy 2 года назад
I have bit unrelated and general question. What do you think about Authentication with JWT and Asp.Net Identity. Is this simple stack enough to create API that's consumed by SPAs. Or should I opt in for advanced stuff like Microsoft Identity
@ssshyambabu
@ssshyambabu 2 года назад
@following
@bookuha
@bookuha 2 года назад
.
@user-qf2xk1fg6e
@user-qf2xk1fg6e Год назад
Привет. Серьезно про латвийский паспорт? А почему так? Я глянул и вроде он дает то же самое, что и другие паспорта EU. Нет?
@RawCoding
@RawCoding Год назад
Нука мачкони тайм стэмп, я вроде про русский паспорт говорил )
@user-qf2xk1fg6e
@user-qf2xk1fg6e Год назад
@@RawCoding проверь 1:35. "If I have a Latvian passport ..."
@user-qf2xk1fg6e
@user-qf2xk1fg6e Год назад
@@RawCoding с русским паспортом в наше время даже на страницу логина не пускают)))
@ВиталийБулдаков-ш4э
Тоже интересно стало, погуглил. Тут речь про паспорт для неграждан
@user-qf2xk1fg6e
@user-qf2xk1fg6e Год назад
@@ВиталийБулдаков-ш4э нет, паспорт негражданина Латвии дает намного больше, чем паспорт гражданина России. Так что тут речь явно не об этом.
@bramburn
@bramburn 2 года назад
That haircut made me watch the video
@1dfe-4e68-bd9f
@1dfe-4e68-bd9f Год назад
Thank you Anton for great videos👍
@RawCoding
@RawCoding Год назад
thank you for watching
@norbertasbrazaitis3730
@norbertasbrazaitis3730 2 года назад
FYI: You should bring back your old haircut :)
@RawCoding
@RawCoding 2 года назад
Nope
@norbertasbrazaitis3730
@norbertasbrazaitis3730 2 года назад
@@RawCoding unsubscribe incoming lol :) :D joke
@bookuha
@bookuha 2 года назад
@@RawCoding !!!!!!!!
@sphericalmasterpiece6338
@sphericalmasterpiece6338 2 года назад
anyone know how to fix it?
@rpreviato
@rpreviato Год назад
Man! You're very good. I'll send to you my brain memory address, can u transfer about 10% of your knowledge please 😁
@Abdullah-vv6zt
@Abdullah-vv6zt 2 года назад
Simplicity soft
@RawCoding
@RawCoding 2 года назад
?
@narsil7350
@narsil7350 2 года назад
I cannot believe now the man without long hair and the look as Jesus 😂
@camenraidercc6625
@camenraidercc6625 Год назад
Hi man, i have a question suppose i have this authorization/authentication builder combos //AUTHENTICATION string adminScheme = "admin-cookie"; string moderatorScheme = "moderator-cookie"; string VIPuserScheme = "vip-user-cookie"; string userScheme = "user-cookie"; builder.Services.AddAuthentication() .AddCookie(adminScheme) .AddCookie(moderatorScheme) .AddCookie(VIPuserScheme) .AddCookie(userScheme); //AUTHORIZATION builder.Services.AddAuthorization(builder => { builder.AddPolicy("admin-policy", policy => policy .RequireAuthenticatedUser() .AddAuthenticationSchemes(adminScheme) .RequireClaim(ClaimTypes.Role, "admin")); builder.AddPolicy("staff-policy", policy => policy .RequireAuthenticatedUser() .AddAuthenticationSchemes(moderatorScheme, adminScheme) .RequireClaim(ClaimTypes.Role, "moderator","admin")); builder.AddPolicy("vip-user-policy", policy => policy .RequireAuthenticatedUser() .AddAuthenticationSchemes(VIPuserScheme, moderatorScheme, adminScheme) builder.AddPolicy("user-policy", policy => policy .RequireAuthenticatedUser() .AddAuthenticationSchemes(userScheme, moderatorScheme, adminScheme) ); }); the first policy is for admin only users endpoints the second is for staff only users which is mainly for moderators but ofc admins can also do their actions the third is for registered users ( which includes mods and admins ) now what if i wanted to have more of a dynamic policy with some actions that can be performed only by certain moderators + all the admins like maybe i want some moderators to be able to edit some posts but not be able to delete them while some other moderators can so it's a mix between Roles and Priviledges assuming i had a DB my User model would look something like this public class User{ //usual stuff, id,username etc public string Role {get; set;} public List Priviledges {get; set;} } i know i could add some extra data in the claims maybe the array of priviledges? but if i were to remove some priviledges to a user they would remain in the cookie so i wonder if there is a better way to approach this? is there a video on your channel that explains something like that ? and if not what would you think a good approach could be ?
@RawCoding
@RawCoding Год назад
thank you for your question. first of all, reduce it all down to a single authentication schema if you can, that's un necessary duplication. for dynamic authorization check this video out: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-x7NxbZNboIc.html
@shiham
@shiham 2 года назад
Thank you!
Далее
Role based Authorization in ASP.NET Core (.NET 7)
16:19
А ВЫ ЛЮБИТЕ ШКОЛУ?? #shorts
00:20
Просмотров 1,9 млн
OAuth 2.0 & 2.1 Explained
39:59
Просмотров 25 тыс.
Authentication Landscape (asp.net core examples)
45:36
Reviewing ASP.NET Core Authentication Setup
14:51
Просмотров 8 тыс.
ASP.NET Core - Roles vs Claims vs Policy
23:11
Просмотров 98 тыс.