Asp Net Core - Rest API Authorization with JWT (Roles Vs Claims Vs Policy) - Step by Step

  Рет қаралды 83,791

Mohamad Lawand

Mohamad Lawand

Күн бұрын

Пікірлер: 78
@marceloleoncaceres6826
@marceloleoncaceres6826 10 ай бұрын
I know this video is 2 years old, but it is OUTSTANDING, Thank you very much for this tutorial.
@MohamadLawand
@MohamadLawand 10 ай бұрын
Glad it was helpful!
@JulianRiverplate14
@JulianRiverplate14 6 ай бұрын
I was trying to implement the same functionality by own so I found your video to find and get a different approach, and i got very surprised about how clean and scalable your implementation was. Thanks for this useful resource Mohamad! I hope you can make new series about Dotnet!
@robydj5289
@robydj5289 3 жыл бұрын
Great, right now I am struggling to learn this topic, your tutorial comes at the right time! Thank you!
@laleshyagysaini4304
@laleshyagysaini4304 4 ай бұрын
Thank you so much Mohamad Lawand i am so much happy to learn from you
@Varinator
@Varinator 3 жыл бұрын
Just found you on youtube as I'm building a boilerplate API for Xamarin/MAUI and refreshing my knowledge - great resources man.
@feelingeverfine
@feelingeverfine 3 жыл бұрын
You’re the man Mohamad. Thanks for making these videos
@mbkfu1
@mbkfu1 7 ай бұрын
Great tutorial! Finally, I was able to understand this topic. Thank you, Mohammed! ❤
@anazz2960
@anazz2960 3 жыл бұрын
Mohamed you are such a hero, I'm a top fan of you and your work, keep it up man ❤
@talkathiriify
@talkathiriify 3 жыл бұрын
Thank you so much Mohamad for your time and effort, it is really appreciated Wish you all the best.
@imranyaseen7880
@imranyaseen7880 Жыл бұрын
Ma'Shaa'Allah. Keep up the good work.❤
@olufemioyedepo2791
@olufemioyedepo2791 3 жыл бұрын
Nice video Mohamad! Great work!
@sibazazo9208
@sibazazo9208 8 ай бұрын
Great video. Thank you for the detailed explanation.
@vaddiprudhvi9292
@vaddiprudhvi9292 2 жыл бұрын
Thank you so much.. your videos are clear and understandable... this is the right place I have to learn more things...
@faicalammisaid3705
@faicalammisaid3705 2 жыл бұрын
thanks my brother very well done so organized and pro written program thank u soo much this work inspired me ! god bless u
@ivanzinov6875
@ivanzinov6875 Жыл бұрын
Good explination!!!. You have a typo in your slides Authorisation => Authorization
@techramedia
@techramedia 3 жыл бұрын
awsome tutorial man...had lots of problem implementing jwt but after watching this..i was able without struggling..Thanks a lot for this tutorial
@dkako1129
@dkako1129 Жыл бұрын
Very good tutorial, you explained it clearly! I would appreciate a deeper dive into policies if its possible. Thanks in advance!
@bmassioui
@bmassioui 2 жыл бұрын
Good explanation, thanks a lot 💪
@marimello9889
@marimello9889 3 жыл бұрын
Very nice. Thank you very much for the videos :)
@fa35ife
@fa35ife 3 жыл бұрын
Great Mohammed, thank u
@expertreviews1112
@expertreviews1112 2 жыл бұрын
You don’t talk about authentication schemes and challenges… This is really critical aspect many people get confused with
@yosofjoo
@yosofjoo Жыл бұрын
Jazak Allah Khairan
@anthonytan2282
@anthonytan2282 3 жыл бұрын
keep it up ur the best😁
@adebanjooluwasola4709
@adebanjooluwasola4709 2 жыл бұрын
Great video Brother
@bankhoagiauten
@bankhoagiauten Жыл бұрын
thank you so much!
@abdulmuminrashed3853
@abdulmuminrashed3853 Жыл бұрын
Great job bro, keep it up. I was wondering if you could share the source code with us.
@talkathiriify
@talkathiriify 3 жыл бұрын
Yes, could you please make more policy like the one in the slides at the beginning of this EP. For example there is a product and assign permissions like view edit create delete the normal CRUD and assign these permissions to the role, That will be highly appreciated. Thank you very much.
@bruno8ribeiro
@bruno8ribeiro Жыл бұрын
Awesome video.
@Moath268
@Moath268 Жыл бұрын
جزاك الله خير شرح جميل
@mihailomarcetic2516
@mihailomarcetic2516 2 жыл бұрын
Great video !!!
@zhamed9587
@zhamed9587 3 жыл бұрын
Thank you so much, great content! One question: can one use the same approach (e.g. `[Authorize]` attribute) on GRPC endpoints instead of REST endpoints?
@sergioontiveros4209
@sergioontiveros4209 8 ай бұрын
Hi there, thanks for the video, it was an amazing explanation, but it seems the project is no longer in your repo. Where can I find it?
@nothingisreal6345
@nothingisreal6345 2 жыл бұрын
Right: grants access to a feature e.g. edit invoice; Role: defined group of rights, a user can be assigne to 0..N roles. Rights resolve from role membership, e.g. roles are Administrator, Normal User, Backup Operator, note: very similar to user groups, roles are typically manually assigned by an Administrator / claims: defined properties like First Name, Department, Country, rights are derived by user depending on values of claim, e.g. user with cost center = 4711 are allowed to accept bills for that cost center. if the users claim changes the access right change automatically. If you do a step by step vidoe you can't leave out the stepp of adding authorization. there are also several errors in logging.
@itwind9912
@itwind9912 2 жыл бұрын
Sir please make video on claims in detail and also add functionality of add rang claims
@ОтгрузкаЕвросвит
@ОтгрузкаЕвросвит 2 жыл бұрын
Brilliant!
@muhammadtaimur448
@muhammadtaimur448 3 ай бұрын
Salam Muhammad, Thanks much for the videos about Authentication using JWTs and Refresh Token mechanism. Videos are very explatory, it helps a lot. I am trying to see your repo for this project in github but I cannot see it, did you delete it? or make it private?, Is there any way I can fork it?
@AlThePal78
@AlThePal78 2 жыл бұрын
The claims sounds like models I am confused with that but I am at 11:49 I will keep watching this video lol
@ucthinh4455
@ucthinh4455 3 жыл бұрын
thanks very much
@amjed_mohammed
@amjed_mohammed Жыл бұрын
Thank you so much
@guedriabdelkalek3946
@guedriabdelkalek3946 2 жыл бұрын
thanks that was helpful
@Nolli360Flip
@Nolli360Flip 2 жыл бұрын
There is one thing that does not work for me. You set 30 seconds for the jwt token. If I use the GET request, the token does not expires after 30 seconds, I tried to wait f.e. 2 minutes and I could still use the same jwt token for the GET request. Only after 5 minutes the request got denied. Did I understood something wrong or why is the jwt token havior different?
@Varinator
@Varinator 3 жыл бұрын
One thing - in GenerateJwtToken you already have logic for RefreshTokens which come in Episode 4 of your tutorial? This may confuse some ppl as in Episode 2 it returns string, and here it's Task and the method is async. Because the method is not async in Episode 2, my IDE returned error when I wanted to await GetAllValidClaims, as the parent method is not yet async as per episode 2.
@adim1212
@adim1212 2 жыл бұрын
Can you please check the starting of the starting project. Currently it's not available.
@hamidshah7072
@hamidshah7072 3 жыл бұрын
thanks to your great course ,how should we store jwt token in secure way ? i undrestand that local storage and cookies are unsafe to store tokens? so what is the best way?
@rickyvu2388
@rickyvu2388 3 жыл бұрын
Aspnet store user in cookie too. I have a same question as you do.
@hamidshah7072
@hamidshah7072 3 жыл бұрын
@@rickyvu2388I understand that we can use HTTP-only cookies and Samesite cookies to prevent access and XSS attack to the token
@MortyMortyMorty
@MortyMortyMorty 2 жыл бұрын
Please can you provide us the source code?
@zergzerg4844
@zergzerg4844 Жыл бұрын
I didn't get how to set the policy. I did all as author showed on a video and authorization scheme by role works for me , but when I add policy authorization , then I added claims for user and an attempt to call a method witch protected by policy it returns 403 error forbidden. Also I checked my JWT token and it had necessary roles and policy. Has anyone had the same problem and how to solve it?
@rickyvu2388
@rickyvu2388 3 жыл бұрын
If someone got my token and edit expireday then the back end will validate and know it is invalid token right? Another case is what if someone copy my token and use it?
@sahild6584
@sahild6584 2 жыл бұрын
@ Mohamad Lawand :Awesome. Can we have more indepth on policies, also can the identity manager be provisioned using SCIM?
@olufemioyedepo2791
@olufemioyedepo2791 3 жыл бұрын
Hi Mohammad I can't seem to find the link to the tutorial for the starting project. I would like to see how you implemented the user management + db migrations etc. Thanks
@MohamadLawand
@MohamadLawand 3 жыл бұрын
Starting Project: github.com/mohamadlawand087/v8-refreshtokenswithJWT
@jayakumar2927
@jayakumar2927 11 ай бұрын
@@MohamadLawand Page not found
@Smcgettrick
@Smcgettrick 3 жыл бұрын
You mentioned a link to an initial starting project that would be in the video and comments, but I cannot find it in either.
@MohamadLawand
@MohamadLawand 3 жыл бұрын
Starting Project: github.com/mohamadlawand087/v8-refreshtokenswithJWT
@BiaoTV
@BiaoTV 2 жыл бұрын
The github no longer contains the code examples?
@andriesmathenjwa9536
@andriesmathenjwa9536 7 ай бұрын
hi i can't find the v8 repository in your git hub
@mmlnv2036
@mmlnv2036 3 жыл бұрын
What happens if the user edits the jwt token and adds a claim he needs for malicious activity ?
@MohamadLawand
@MohamadLawand 3 жыл бұрын
The JWT signature will be invalidated and the API will not recognise it
@mmlnv2036
@mmlnv2036 3 жыл бұрын
@@MohamadLawand Thanks Mohamad
@mohammadakbari1944
@mohammadakbari1944 2 жыл бұрын
very good
@muhammadsaad1520
@muhammadsaad1520 Жыл бұрын
i don't find the github repo you mentioned
@RishavKarna
@RishavKarna 6 ай бұрын
the git repo is not available!?
@Gilgameshx
@Gilgameshx 2 жыл бұрын
Hi moha, nice work and great explained as usual, yet i have a question: How we could make a dynamic policy? i meant if the app super admin needs to create dynamic policies Thanks man
@muntheralkhwaldeh728
@muntheralkhwaldeh728 2 жыл бұрын
Thank You for your effort , in my mvc app alwayes give me Unauthorized 401 after Applying the roles and claims can anyone help me
@nooral_huda7342
@nooral_huda7342 Ай бұрын
Where have you been all this time 😞
@JBRandria
@JBRandria 2 жыл бұрын
Hello, Github link is not found :(
@tiktokfans9019
@tiktokfans9019 Жыл бұрын
I do not find this repository in your GitHub account
@adnanyangilic6380
@adnanyangilic6380 3 жыл бұрын
Dear Mohamad, could you upload github the same this project also with sql server when you have time? Thank you..
@imaneliyev6447
@imaneliyev6447 2 жыл бұрын
Souce Code is not aviable in github(
@Razboinikov80
@Razboinikov80 2 жыл бұрын
The code is no longer available in your Git
@FabioGalanteMans
@FabioGalanteMans 3 жыл бұрын
Impossible see the video in cell phone
@piotrus5457
@piotrus5457 2 жыл бұрын
The final version of the code lacks the disabling of checking whether the token has expired when it is refreshed. If anyone has a problem with this, just change the line "var tokenInVerification = jwtTokenHandler.ValidateToken(tokenRequest.Token, _tokenValidationParams, out var validatedToken)" | | V at | | V "_tokenValidationParams.ValidateLifetime = false; var tokenInVerification = jwtTokenHandler.ValidateToken(tokenRequest.Token, _tokenValidationParams, out var validatedToken). _tokenValidationParams.ValidateLifetime = true; "
@Tareknageh1999
@Tareknageh1999 Жыл бұрын
جزاك الله خيرا
Master Refresh Tokens in ASP.NET Core (building from scratch)
17:19
Milan Jovanović
Рет қаралды 12 М.
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН
Cheerleader Transformation That Left Everyone Speechless! #shorts
00:27
Fabiosa Best Lifehacks
Рет қаралды 16 МЛН
IL'HAN - Qalqam | Official Music Video
03:17
Ilhan Ihsanov
Рет қаралды 700 М.
Adding JWT Authentication & Authorization in ASP.NET Core
17:24
Nick Chapsas
Рет қаралды 233 М.
128. What Authentication System Should I Use For My App?
20:41
IAmTimCorey
Рет қаралды 72 М.
Basic Auth: Roles, Policy, Claims (ASP.Net Core Stuff You Need To Know)
20:19
Just Blazor Programming
Рет қаралды 7 М.
Stealing Baseball Signs with a Phone (Machine Learning)
13:30
Mark Rober
Рет қаралды 28 МЛН
I Helped 2,000 People Walk Again
15:31
MrBeast
Рет қаралды 24 МЛН
Сборник Эксклюзивов 2024 - Уральские Пельмени
1:33:24
Уральские Пельмени
Рет қаралды 1,4 МЛН
Best of CES 2025
14:50
The Verge
Рет қаралды 469 М.
Implementing JWT Authentication in ASP.NET Core
23:51
Nick Chapsas
Рет қаралды 48 М.
Session Vs JWT: The Differences You May Not Know!
7:00
ByteByteGo
Рет қаралды 316 М.
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН