Authentication & Refreshing Tokens Implementation

  Рет қаралды 226,798

Dennis Ivy

Dennis Ivy

Күн бұрын

Implementing JWT access and refresh token authentication with Django & React using the timed interval method.
Source Code: github.com/divanov11/refresh-...
Axios Interceptor Method: • Refreshing Tokens With...
Timestamps
00:00 - Intro
4:15 - Setting Up Django Project
12:15 - Adding Django REST Framework
15:24 - Adding Simple JWT
22:00 - Customizing JWT Settings
23:25 - Access & Refresh Token Lifespan
24:32- Rotating Refresh Tokens
26:25 - Blacklisting Refresh Tokens
30:00 - Customizing Token Claims
34:38 - CORS Configuration
38:30 - Setting up React Files
51:25 - Private Routes
58:25 - Setting up AuthContext
1:04:24 - Login User
1:20:00 - Get user state from local storage on load
1:29:45 - Logout User
1:31:30 - Refresh & Rotating Tokens
1:45:10 - Setting Up User Items in DB
1:52:20 - Adding Protected Endpoints
1:54:30 - Rending user items
2:01:35 - Logout user on fail
2:04:45 - Refreshing Token on load

Пікірлер: 290
@parthmittal5625
@parthmittal5625 2 жыл бұрын
Thank you so much Dennis! Whenever I need anything related to Django, I just always come to your videos!!
@gregruiz921
@gregruiz921 2 жыл бұрын
This is very high quality content Dennis... thank you for your time and effort put into this production.
@NotMixu
@NotMixu 2 жыл бұрын
This was exactly what I needed. Thanks Dennis
@mattiepro2494
@mattiepro2494 2 жыл бұрын
This is the second time your tutorials have saved my life! I cannot thank you enough. YOU ARE MY HERO!
@mintesnottariku5309
@mintesnottariku5309 2 жыл бұрын
What a perfect timing.. amazing .. last night I was looking for this kinda video and after 6 hours I hv seen my Django-guy made it!
@NOTHING-en2ue
@NOTHING-en2ue Жыл бұрын
you know what there is no teacher that teaches this for free, you're the best teacher i've ever seen ❤
@victoralexandre9653
@victoralexandre9653 7 ай бұрын
Amazing content, Dennis! Your channel is helping a lot with my first Django+React application. Please continue, really rich video!
@griftegrd
@griftegrd Жыл бұрын
Thank you so much for this really, really high quality video. Very informative, explanations were on point and even the errores were interesting as it happens to everyone, even someone who knows their game like you (which makes me feel a little better :)) I finally understand the logic of JWT and can implement it in my django/angular project. My best wishes to you, and thanks again for this fine content.
@schalkolivier7363
@schalkolivier7363 2 жыл бұрын
Thank you very much for the awesome content!! I have used React combined with firebase and Django (standalone) but never used them together. This video was really informative and helped me migrate my current frontends (Django Templates) to React.
@kaz372
@kaz372 Жыл бұрын
So much covered in one video, thank you !
@mastermaster153
@mastermaster153 Жыл бұрын
oh dude you saved my life too, i was looking for a tutorial about this with react and django and nothing but i found out this video and just saved my life, thank u so much!!!!!! you're a genious thaaankks!!!!! so much
@jasbirsingh-mv5vh
@jasbirsingh-mv5vh Жыл бұрын
Came here for django authentication, along with the authentication part , this tutorial cleared my context API fundamentals too :)
@waleedabdulmanea5301
@waleedabdulmanea5301 2 жыл бұрын
I really was looking for any tutorial that explains how to apply the refreshing token, but no luck .. anyway you are a legend thanks a lot
@MuhammadAyaz-gp7xd
@MuhammadAyaz-gp7xd 6 ай бұрын
Bestest Tutorial about JWT with Django on KZbin. Thank you so much sir, for making this premium grade content for free.
@grigors2
@grigors2 2 жыл бұрын
I almost never like videos, but ty bro you deserved it too much. I f*** love react + django and you just made everything for me so simple.
@vidyasanap7613
@vidyasanap7613 Жыл бұрын
this is really useful and detailed video on authentication. It helped me a lot . Thanks Dennis.
@faneto9608
@faneto9608 2 жыл бұрын
Amazing video Dennis, really enjoyed it ♥
@RealSLK
@RealSLK Жыл бұрын
Very very very helpful video. Approach and explanations are great. Code is slightly outdated due to updates (router dom v6) but nothing a little research can't fix and you have updated videos on the subject too! Thank you.
@kozol7
@kozol7 Жыл бұрын
This is exactly what I have been looking for! Complete and well explained.
@alexcondurachi8423
@alexcondurachi8423 Жыл бұрын
i think the jwt token must be decoded only in the server with a private key
@zhe-jiazhang9535
@zhe-jiazhang9535 2 жыл бұрын
thank you very much. I learn JWT just in three day by your video.
@everythingjdm8057
@everythingjdm8057 Жыл бұрын
beautiful tutorial man i love it been looking for this for while now
@pushkarkumar7173
@pushkarkumar7173 2 жыл бұрын
Awesome lecture. Please watch this 2hr and it will save your whole one day in internet surfing
@MasayaShida
@MasayaShida Жыл бұрын
this is very valuable and thank you for explaining things thoroughly!
@007unmesh
@007unmesh 6 ай бұрын
This is very high quality content. Very appriciated Thanks Dennis From INDIA, KERALA, THRISSUR, KODAKARA
@timeforrice
@timeforrice Жыл бұрын
Great content, format and quality!!
@MoisesVillalbaSilvero
@MoisesVillalbaSilvero 11 ай бұрын
Thanks Dennis! Amazing tutorial... Congrats from Paraguay!
@gabrielros1
@gabrielros1 Жыл бұрын
Very Very good in-depth auth tutorial. Thank you. this is what the people need ! Suuuuuubscribed !
@theanonymous5268
@theanonymous5268 2 ай бұрын
Great Video! Just a note for anyone watching the video, "If you don't get it, you probably aren't ready for it yet" because Dennis explains pretty well.
@rajat0610
@rajat0610 Жыл бұрын
i was looking for exactly this!! thank you so much!!
@swannhs
@swannhs 2 жыл бұрын
Thank you so much. I was really struggle for this
@appaloosa_
@appaloosa_ 9 ай бұрын
Just what i was looking for + more. thanks!
@llraekll
@llraekll Жыл бұрын
React-Router-dom in video is the previous version, this is for anyone using React-Router-dom v6. The must be wrapped around as shown below This works for v6
@honestoliveoil
@honestoliveoil Жыл бұрын
This is true. But when I try and implement the PrivateRouter and wrap the PrivateRouter in , React breaks because PrivateRouter isn't a Route. Did you find a solution to this?
@munawar1288
@munawar1288 Жыл бұрын
@@honestoliveoil yaa i too got like that. any fix?
@habibi4579
@habibi4579 Жыл бұрын
@@munawar1288 dont forget to initialize user variable
@yourmoodfromme
@yourmoodfromme Жыл бұрын
@@honestoliveoil # BrowserRouter ...
@theelofiguy
@theelofiguy Жыл бұрын
sure
@GeorgeFemiwise
@GeorgeFemiwise Жыл бұрын
you saved my life of frustration thank you Dennis.
@josewilhelm2717
@josewilhelm2717 2 жыл бұрын
Just what I needed. Thanks!
@Andremzsptm
@Andremzsptm 2 жыл бұрын
That's exactly what I need. Thanks
@StickMan1316
@StickMan1316 2 жыл бұрын
Lol I was about to post that but I'm 8 months late.
@017m.shahzaibafzal4
@017m.shahzaibafzal4 2 жыл бұрын
Thanks Dennis Sir. You are my Best teacher.
@SnoopLobster
@SnoopLobster 2 жыл бұрын
agreed.
@codewithwizdom
@codewithwizdom Жыл бұрын
Thanks Denis.. You have really been helping career
@eriche9296
@eriche9296 2 жыл бұрын
Amazing work, thank you!
@user-mo9kt1hr3d
@user-mo9kt1hr3d Жыл бұрын
좋은 강의 영상 감사합니다 :)
@abhishekupadhyay6938
@abhishekupadhyay6938 Жыл бұрын
Thank you very much for teaching this. I learned a lot from videos.
@DennisIvy
@DennisIvy 2 жыл бұрын
New video on adding refresh with axios interceptors instead of timed updates: kzbin.info/www/bejne/Z2eQYqCKmax1pa8. I know a lot of people were asking about this.
@VadimSchulz
@VadimSchulz 2 жыл бұрын
thank you for your useful tutorials
@djangofullcourse1171
@djangofullcourse1171 2 жыл бұрын
Thanks for the tutorial! I never worked with tokens and auth, and was really confused about them, but after this video everything became clear.
@zenande699
@zenande699 2 жыл бұрын
Aren't you supposed to be a Django expert?
@griftegrd
@griftegrd Жыл бұрын
@@zenande699 lol
@hiefall7023
@hiefall7023 25 күн бұрын
You are my savior! Thanks for your content
@pacheking4605
@pacheking4605 8 ай бұрын
HIGH QUALITY CONTENT!!! THANKS U
@Teddyrobinson
@Teddyrobinson 5 ай бұрын
Learning a ton! Thanks so much
@achrafbouzekri709
@achrafbouzekri709 2 жыл бұрын
you are the man we need !
@zoltanmolnar6956
@zoltanmolnar6956 2 жыл бұрын
very sophisticated course, included with beginners mistakes (False, so on..) however I bought all of your courses, but sometimes just funny, but big respect you are trying to show us production ready things, not just useless , common educational apps
@daughterofanartist7223
@daughterofanartist7223 Ай бұрын
Thank you!! It's super useful 👏🏻👏🏻👏🏻
@abhishekk1231
@abhishekk1231 2 жыл бұрын
Loved this Video!! Thank you :))
@raduciurca
@raduciurca 2 жыл бұрын
For PRIVATE ROUTES: if you aren't redirected to login when you go to the home page from the header link, try wrapping the route tags (private and normal route) with the tag.
@dracula1347
@dracula1347 Жыл бұрын
Awesome bro, respect
@Pewpewpew230
@Pewpewpew230 Жыл бұрын
Great effort, thank you!
@sujal1583
@sujal1583 4 ай бұрын
Thank You Very Much. This helps a lot!!!!
@williammorris7157
@williammorris7157 2 жыл бұрын
This is perfect, thanks!!
@anand_dudi
@anand_dudi 2 жыл бұрын
Peferct time when i just finished a videos on it to implement on my project
@theetawee
@theetawee 6 ай бұрын
Thank sir. So useful 🤟🏼
@manavlakhanpal759
@manavlakhanpal759 2 жыл бұрын
Waiting for it 💙
@DennisIvy
@DennisIvy 2 жыл бұрын
Its here ;)
@ajithrt123
@ajithrt123 3 ай бұрын
Thank yo so much. Very helpful and informative. Expecially for a beginer like me.
@yousufummar9282
@yousufummar9282 2 жыл бұрын
That's what I was looking for, thanks for creating this usefully tutorial you help me alot, honestly you're a life server. But I can't wait to see another tutorial like this by using axios
@jamesthomason4788
@jamesthomason4788 2 жыл бұрын
Hi everyone! if you are having trouble with at 49:50 with Route component.... component was replaced in favor for element! I also had to wrap my Route tags in a Routes tag, so it would look more like.
@adnank7496
@adnank7496 2 жыл бұрын
Thanks bro. I was looking for this. Do you know why is that?
@jamesthomason4788
@jamesthomason4788 2 жыл бұрын
@@adnank7496 just the implementation changed with updates
@jakhongirturgunboev8593
@jakhongirturgunboev8593 2 жыл бұрын
Thank you, it was indeed helpful
@joaoarthurbandeira
@joaoarthurbandeira Жыл бұрын
Hey Dennis! Excellent tutorial, as always! Can you also show us how to do registration and also how a logged in authenticated user can do post requests to create/update notes? Cheers, bro!
@jondebosco7478
@jondebosco7478 11 ай бұрын
Nice job boss!!
@mishagavura7859
@mishagavura7859 2 жыл бұрын
Best of the best!
@bhuvanbiju9203
@bhuvanbiju9203 2 жыл бұрын
Awesome dude
@dmitriisergeev306
@dmitriisergeev306 Жыл бұрын
Perect video. Thank you a lot
@FARX_Games
@FARX_Games 2 жыл бұрын
thank you i made this with flutter and django .
@BekzodToshpulatov-ev3jv
@BekzodToshpulatov-ev3jv Жыл бұрын
Thank you broo you helped me
@tanaysheth8601
@tanaysheth8601 2 жыл бұрын
Me: *Bunking scool* to attend your videos 😄😆☺
@maroso_
@maroso_ Жыл бұрын
thanks for this tutorial
@ahmedghamdhan2729
@ahmedghamdhan2729 Жыл бұрын
YOU ARE THE BEST❤❤❤
@AlessiaCaraFans
@AlessiaCaraFans Жыл бұрын
thank uuuuuuuuu so much you saved my life
@winter8476
@winter8476 Жыл бұрын
Replace components = {HomePage} to element={} do the same for login and then make you wrap the in a parent . Import from the 'react-router-dom'.... any confusion reply with your issue and also Note that in v6 of react Routes Redirect has been replaced with Navigate so just swap and it would work
@ayushmantiwari6441
@ayushmantiwari6441 2 жыл бұрын
bro u r just awsome
@hdd3065
@hdd3065 2 жыл бұрын
Thank you very much
@Squinnmb
@Squinnmb 2 жыл бұрын
Thank you!
@yusufkalyoncu8704
@yusufkalyoncu8704 Жыл бұрын
thank you nice content.
@santanu8899
@santanu8899 Жыл бұрын
You are the best teacher and I love watching your video. It will be very helpful if you make videos on vuejs. please 😌 ...
@aryan7069_
@aryan7069_ 2 жыл бұрын
My honest thoughts. I knew React Django but i restricted my self to build React +Django projects having authentication because i thought i can not handle authentication . And therefore build only projects with django templating language . Finally I got this playlist Thanks man
@niteshswarnakar
@niteshswarnakar 2 жыл бұрын
same went for me in my college project. I had to use django templating since it is so hard to make user authentication in react + django
@alizabetpour
@alizabetpour 2 жыл бұрын
make more video like this for react and backend thank you
@merabetzakaria2736
@merabetzakaria2736 2 жыл бұрын
Merci beaucoup!
@meoconhoccode
@meoconhoccode Жыл бұрын
thank you very much
@usamausman-dev
@usamausman-dev Жыл бұрын
In React-Router-dom version 6 , there is bit difference.... We need to wrap the our tags inside and instead of using component attributes we need to use element as an attribute and pass the component like this .... element= {}
@dinokrivic5486
@dinokrivic5486 Жыл бұрын
and also useNavigate instead of userHistory
@rizwanriaz8706
@rizwanriaz8706 Жыл бұрын
Using PrivateRoute is also not displaying anything for me..
@saphalpantha9865
@saphalpantha9865 Жыл бұрын
@@rizwanriaz8706p plz help same problem here
@sserunkumaenock2159
@sserunkumaenock2159 Жыл бұрын
For me I get a problem of invalid token when a user opens his profile but sign in all is ok
@darksouls1216
@darksouls1216 Жыл бұрын
Knock knock ○●○
@shehramtahir3555
@shehramtahir3555 Жыл бұрын
Good job (y) Suggestion: You could have used setTimeout instead of setInterval so you don't have to return a clear interval method :)
@karunyamohan5866
@karunyamohan5866 2 жыл бұрын
Thank you
@Araaawsh
@Araaawsh 2 жыл бұрын
thank you مرسی
@SulamitaRazumovskiy
@SulamitaRazumovskiy Жыл бұрын
Thanks!
@jiweihe3413
@jiweihe3413 Жыл бұрын
Thank you for the helpful video. Do you have a video for adding different role permissions for rest frame work?
@bismarcknyaboemomanyi6125
@bismarcknyaboemomanyi6125 2 жыл бұрын
great, i like what you are doing, thanks
@mohamedyoussef8835
@mohamedyoussef8835 2 жыл бұрын
Awesome ++++++++++++++++++++ Thank you
@adfgejshcylwnoaoxgoakwoxio9703
@adfgejshcylwnoaoxgoakwoxio9703 Жыл бұрын
more thanks
@techguru151
@techguru151 5 ай бұрын
Excellent ^ 64
@iqrarahmad1725
@iqrarahmad1725 8 ай бұрын
Great
@aminghasemi
@aminghasemi 11 ай бұрын
Hey Dennis, Thank you this is really helpful. do you have any other video for the registration and forgot password process?
@abhisheksanjaygawade1479
@abhisheksanjaygawade1479 2 жыл бұрын
More video on React and Django
@0730pleomax
@0730pleomax 2 жыл бұрын
Finally...
@fahansheikh
@fahansheikh 10 ай бұрын
people suffering with changing the router version 5 to 6 for this tutorial " this guys has a video on that as well " might help"
@andrii5345
@andrii5345 2 жыл бұрын
27:31 google translate in chrome recognized those long JWT tokens as Polish lmao
@vigneshkarthik345
@vigneshkarthik345 Жыл бұрын
Hi Dennis bro, your doing awesome video ❤, can you please tell me what theme your using in your vs code
@yeyintaung9837
@yeyintaung9837 8 ай бұрын
thz man
Django Real Time Chat With Agora SDK
2:38:42
Dennis Ivy
Рет қаралды 12 М.
路飞被小孩吓到了#海贼王#路飞
00:41
路飞与唐舞桐
Рет қаралды 69 МЛН
Incredible magic 🤯✨
00:53
America's Got Talent
Рет қаралды 74 МЛН
когда повзрослела // EVA mash
00:40
EVA mash
Рет қаралды 4,5 МЛН
Became invisible for one day!  #funny #wednesday #memes
00:25
Watch Me
Рет қаралды 57 МЛН
Refreshing Tokens With Axios Interceptors
39:55
Dennis Ivy
Рет қаралды 87 М.
Difference between cookies, session and tokens
11:53
Valentin Despa
Рет қаралды 599 М.
50 YouTubers Fight For $1,000,000
41:27
MrBeast
Рет қаралды 105 МЛН
How To Make a Django REST API - Full Tutorial & Deployment
40:18
Tech With Tim
Рет қаралды 62 М.
Django To Do List App With User Registration & Login
2:12:03
Dennis Ivy
Рет қаралды 327 М.
Oh, Auth Doesn't Have to Suck?
7:16
Josh tried coding
Рет қаралды 56 М.
Эй Рамазан # DamirAgroDizel
0:16
DamirAgroDizel
Рет қаралды 6 МЛН
So Cruel!😩 Say No To Turtle Painting🐢🎨 #catvideos #catmemes #trending
0:24
Хитрая МАТЬ делит НАСЛЕДСТВО между ДЕТЬМИ 😱 #shorts
1:00
Лаборатория Разрушителя
Рет қаралды 10 МЛН