Тёмный

Django API Authentication using JWT Tokens 

Scalable Scripts
Подписаться 34 тыс.
Просмотров 169 тыс.
50% 1

👉 Check our website: scalablescripts.com
Python Django login and generate JWT Token using HttpOnly Cookies. We will Login using JWT( JSON Web Token ) which is the standard method for SPA Authentications. We will not use the traditional "Bearer method" but instead we will login using HttpOnly cookies which is a more secure authentication.
Source Code: github.com/scalablescripts/dj...
This video can be combined with other videos:
React and Django JWT Authentication: • React & Django JWT Aut...
VueJs and Django JWT Authentication: • VueJS & Django JWT Aut...
Angular and Django JWT Authentication: • Angular & Django JWT A...
NextJS and Django JWT Authentication: • NextJS & Django JWT Au...
NuxtJS and Django JWT Authentication: • NuxtJS and Django JWT ...
Svelte and Django JWT Authentication: • Svelte & Django JWT Au...
00:00 Preview
00:28 Django Rest Framework Setup
02:48 User Model
05:43 Database
08:47 Register
19:21 Login
30:22 Authenticated User
35:01 Logout
#python #django

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

 

26 июн 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 199   
@learningchannel4001
@learningchannel4001 2 года назад
The best token based Authentication I have watched. Very detailed. Thank you
@dawoodsiyam512
@dawoodsiyam512 10 месяцев назад
man you are the best, straight to the point, no copy pasting, and very easy and readable code and step by step process, something that lots of tutorials struggle with, thank you so much.
@abdirahmanabdullahi1966
@abdirahmanabdullahi1966 5 месяцев назад
Is loggingView working for you?
@aryanagarwal2257
@aryanagarwal2257 2 года назад
Thank You! You have explained it so clearly, I haven't been able to understand this since days but with this one I was able to easily
@HEATER_APP
@HEATER_APP Год назад
super straightforward and concise, great job!
@shagilislam2533
@shagilislam2533 24 дня назад
Truly the smoothest and most accurate Django-JWT Tutorial I've ever seen!!!
@EveryGameArchive
@EveryGameArchive Год назад
Thanks! I had hard times trying to discover how to use jwt and you solved all questions that i had.
@nicolasportelli3766
@nicolasportelli3766 Год назад
Very good video! Without getting lost in the bush, getting to the concept clearly Greetings from Argentina!
@raulemilianomirandagutierr3313
@raulemilianomirandagutierr3313 3 года назад
Man you don't know how much I appreciate this video, let me tell you I've been looking for something like this for weeks, let me tell you there's nothing.
@jaitungodhani2334
@jaitungodhani2334 2 года назад
plz tell me if you know how i applied Bearer method in video video instead of cookies.
@jasonvilla3696
@jasonvilla3696 3 месяца назад
Watching this today, although this is 3 years ago and there is an optimized way to use JWT, this really helped me understand what happens during a JWT authentication. Kudos
@MissoyKE
@MissoyKE 2 месяца назад
share link for the optimized way
@devniel
@devniel Год назад
Awesome! thanks for your explanation. I just want to remind these typical topics for django, it always important to continue improving our skills.
@thabosiphiwemngoma1859
@thabosiphiwemngoma1859 6 месяцев назад
This is an amazing video. So clear. Answered most of my questions before I asked them.
@gamingfundas
@gamingfundas 3 года назад
very well explained....loved this. Yeah, some exceptions are that, the person has to make a create_superuser function to create a superuser but its fine. JWT explained wonderfully
@allanalais7859
@allanalais7859 2 года назад
in serializer?
@bilaltufaildev
@bilaltufaildev 3 месяца назад
Perfect Tutorial for basic auth so far. Loved it! Keep it up Sir! 💖
@konstantinoskostopoulos9794
@konstantinoskostopoulos9794 3 года назад
Thanks a lot man, I had a hard time until I saw this one. The explanations were on point as well, cors even fixed a front-end problem my team had. Hope you grow big!
@ScalableScripts
@ScalableScripts 3 года назад
Glad it helped!
@nepdevtech
@nepdevtech 3 года назад
@@ScalableScripts I am getting error while decoding the token in userview
@goodboy435
@goodboy435 2 года назад
@@nepdevtech me too... For me it says. " 'str' object has no attribute 'decode' " Have u got the solution??
@jayantpatankar5967
@jayantpatankar5967 2 года назад
@@ScalableScripts why I am getting - RecursionError: maximum recursion depth exceeded while calling a python object. How to solve...
@loganathant9840
@loganathant9840 Год назад
​@@goodboy435 decode is not needed since its already decoded remove the decode and it will work
@zakariaazahaf394
@zakariaazahaf394 2 года назад
I dont usually comment on yt videos, but this video is so damn good, with your explanations and the way how you talk. Keep up brother
@sushovitshah9083
@sushovitshah9083 3 месяца назад
Best video for drf authentication. Totally loved it and learned a lot.
@abbaskareem5281
@abbaskareem5281 Год назад
This is the best video on JWT and tokens in django and django-rest-framework ... thank you million times sir ❤❤
@sorooshmoghimi5494
@sorooshmoghimi5494 Год назад
that was really helpful, and very straightforward! Thank you so much.
@davidadu-tenkorang3186
@davidadu-tenkorang3186 3 года назад
Excellent work. Thank you
@pradyumnabharadwaja8237
@pradyumnabharadwaja8237 Год назад
The best explainantion and ONPOINT, loved it, Thank you 🙏
@shadmanlatif6530
@shadmanlatif6530 2 года назад
Legit helped me
@manolismandamadiotis5853
@manolismandamadiotis5853 2 года назад
very helpful video and keeping it simple tthanks!
@ogakurosaki
@ogakurosaki 3 года назад
Such a dope explanation 🔥🔥🔥
@maksymmalicki2720
@maksymmalicki2720 Год назад
Amazing tutorial, thank you very much!
@keshavachandu99
@keshavachandu99 Месяц назад
I learnt a lot here Thank You !!!
@rashedulhasanporosh7722
@rashedulhasanporosh7722 2 года назад
Thank you so much. It was a great help!
@johntygomes6519
@johntygomes6519 3 года назад
Very Greeat Explanation Sir...ThankYou
@marcellacarvalho6705
@marcellacarvalho6705 2 года назад
Thank you for this. You are awesome!
@imcamilaaa
@imcamilaaa 3 года назад
thank you so much for the video, because of this now i and my group can sleep in peace hahahaha
@shashishekhar----
@shashishekhar---- 9 месяцев назад
Great content, subscribed !
@nicklennonfortes9611
@nicklennonfortes9611 Год назад
best teacher ever
@luisematos_
@luisematos_ 2 года назад
I have to say THANK YOU!
@jorgeperalta9780
@jorgeperalta9780 21 день назад
awesome video! Thank you!
@abcrectify6916
@abcrectify6916 2 года назад
Thanks for making this video.
@user-en1km2zj5v
@user-en1km2zj5v 4 месяца назад
thank you very much. excellent presentation of the material
@frankydubi
@frankydubi 2 года назад
The biggest THANK YOU!
@_nishadkv
@_nishadkv 2 года назад
Helps a lot.. Thanks buddy
@Acel-01
@Acel-01 2 года назад
GREAT Tutorial!
@jakubrudy9372
@jakubrudy9372 3 года назад
thank you for this tutorial very much!
@hyunjungoh6672
@hyunjungoh6672 2 года назад
I love this video!!!!! the best ever!
@edwardzombie9222
@edwardzombie9222 Год назад
Спасибо большое за урок! Очень помог!
@user-dev953
@user-dev953 Год назад
This was very helpful thank you
@Experts_top_5
@Experts_top_5 Год назад
Excellent man!! thanks a lot
@NiM44
@NiM44 2 года назад
Very well explained , Thanks
@nguyenichthanhtu8502
@nguyenichthanhtu8502 Год назад
This is Awesome, helpful for me. Thanks
@yaroslavstetsko4174
@yaroslavstetsko4174 2 года назад
It is perfect tutorial, thank u, and continue.
@aleksandrsemenov1764
@aleksandrsemenov1764 2 года назад
Great job, thanks!
@achrafbilal4200
@achrafbilal4200 3 года назад
The best (from morocco)
@anarbairam
@anarbairam Год назад
great explanation!
@k1vz_
@k1vz_ 4 дня назад
very nice, thank you!!
@jadedanial3255
@jadedanial3255 Год назад
great tutorial! thumbs up!
@Travellife8877
@Travellife8877 3 года назад
just osm content and step by step explaination
@PartimeMemer
@PartimeMemer 10 месяцев назад
Amazing tutorial dude
@paasxx
@paasxx 11 месяцев назад
Superb content, very helpful
@majmunovski
@majmunovski 3 года назад
Thank you very much!
@ArghyaBhattacharyaNITA
@ArghyaBhattacharyaNITA 2 года назад
Thanks for the clear explanation. Bdw, what about the refresh token.. don't we need that as well ??
@engrnasirshah4426
@engrnasirshah4426 2 года назад
Thanks very will explanation
@juiceearthhh7225
@juiceearthhh7225 Месяц назад
Thanks helped a lot
@adhy612000151
@adhy612000151 5 месяцев назад
Thanks a lot good man! God always bless you!
@adhy612000151
@adhy612000151 5 месяцев назад
Many Many Thanks For you good man!
@duberlyivanmondragonmancha6198
@duberlyivanmondragonmancha6198 9 месяцев назад
Good video!!
@muruganraja9
@muruganraja9 2 года назад
Excellent tutorial,
@ScarxciaSkaix
@ScarxciaSkaix 2 года назад
Thank you so much!
@muskulanikhil3623
@muskulanikhil3623 2 года назад
you are a life save dude
@toufikbenkhelifa917
@toufikbenkhelifa917 2 года назад
can i ask u ?
@mayankdandwani9951
@mayankdandwani9951 2 года назад
Superb Content Bro
@na_na_na6577
@na_na_na6577 Год назад
Thank you very much
@markgemesi6783
@markgemesi6783 Год назад
thanks, good video
@joventan4303
@joventan4303 2 года назад
Thank you! :)
@faridhabibli625
@faridhabibli625 2 года назад
Thanks a lot man
@estrum1647
@estrum1647 7 месяцев назад
amazing video
@nikhilaryal5589
@nikhilaryal5589 Год назад
Thanks man!!
@understand1004
@understand1004 Год назад
26:10 dont need to .decode("utf-8") just token = jwt.encode(payload, 'secret', algorithm='HS256') that's it
@mrek1668
@mrek1668 Год назад
Great video! If I'm using Django templates instead of a separate front end, can I still use JWT for authentication?
@ivanromanov7120
@ivanromanov7120 7 месяцев назад
Thank you for video! Can you tell what is the soft you use for DataBase on 06:42 ?
@eltondias649
@eltondias649 2 года назад
Thank you so much
@gregoryzhang743
@gregoryzhang743 2 года назад
this is awesome
@gregocanepa
@gregocanepa 3 года назад
Awesome tutorial dude! One question: at 21:08 when you are fetching the user from the db, why do you do a filter and then a first instead of simply a get()? Thanks!
@souravjha2146
@souravjha2146 2 года назад
filter(), whenever you expect more than just one object that matches your criteria. If no item was found matching your criteria, filter() returns am empty queryset without throwing an error. get(), you expect one (and only one) item that matches your criteria. Thus if there are more than one objects returned in queryset we would know that via filter
@hamzardaideh653
@hamzardaideh653 2 года назад
Thank you 🤩
@HarshitGupta-vo5bm
@HarshitGupta-vo5bm Год назад
is that pyjwt assigns refresh token to user , just like simple jwt does ? also does it refresh tokens automatically after expiration time ?
@Developer_python_
@Developer_python_ 4 месяца назад
The best movie that I saw!
@achirasilva2567
@achirasilva2567 2 месяца назад
bruh
@shubhamathawane02
@shubhamathawane02 3 месяца назад
Can you tell how can i send token from frontend to backend again for each request as i am storing it as cookie on frontend ?
@yusupovjasur
@yusupovjasur 2 года назад
Great tutorial, you've earned a sub!
@Craennie
@Craennie 5 месяцев назад
The cookies aren't saving automatically when I use ReactJs - Axios. How can I save the cookies automatically and also send it as part of the request using Axios or Fetch API
@ragomar8040
@ragomar8040 2 года назад
Thanks!!
@prashantrao9456
@prashantrao9456 3 года назад
You saved me bro....
@TommyBrick
@TommyBrick 3 года назад
Hi, great video! One question: At @26:12, why did you decode the token? I get the error "'str' object has no attribute 'decode'" If I drop the decoded I get a decoded string.
@matteob9342
@matteob9342 3 года назад
Hi, You can downgrade the PyJWT package to 1.7.1 or remove the call to decode. It should work
@TommyBrick
@TommyBrick 3 года назад
@@matteob9342 removed .decode() and it dit work fine afterwards. Thanks!
@goodboy435
@goodboy435 2 года назад
Got same error.. Just after an year.
@goodboy435
@goodboy435 2 года назад
@@matteob9342 thanks matteo... Ur removing decode() call method worked for me too...
@toufikbenkhelifa917
@toufikbenkhelifa917 2 года назад
@@goodboy435 how can i do it ?
@salehm9631
@salehm9631 2 года назад
Thank you
@omarchristie3923
@omarchristie3923 Месяц назад
Hey, I did this auth and now connecting it to Vue js frontend but when I sign out, I am still able to access protected views that need authentications. Only when I clear the browser cookie do the access stop. Also the cookie is still within the header when I sign out. How can I fix this? it work fine in postman.
@kevinbeano1916
@kevinbeano1916 2 года назад
great tutorial. How about the guard ?
@Nikhil-Tomar
@Nikhil-Tomar 11 месяцев назад
What about CSRF policies and securities, Why are they not applied here?
@javohirerkinov4078
@javohirerkinov4078 2 года назад
Thanks bro
@angwamoses5005
@angwamoses5005 2 года назад
Please, how can i use django default isAuthenticated permission instead of having to check if the token is in cookie.
@achirasilva2567
@achirasilva2567 2 месяца назад
There's a issue with "utcnow()" function in newer django versions. My cookie instantly get deleted.
@RiderGopal0102
@RiderGopal0102 2 года назад
Tysm. Plz login using role such admin, user,student,teacher..plz make video on this
@musicbrorijit
@musicbrorijit Год назад
Does this work for multiple users getting logged in and out at the same time?
@phunguyentrong722
@phunguyentrong722 2 года назад
thanks a lot
@gautammishra96
@gautammishra96 3 года назад
Don't we have to invalidate the JWT before removing it?
@AshishSingh-dn8wb
@AshishSingh-dn8wb 3 года назад
Can we use this cookie based authentication with React Native?
@JohnBiddulph
@JohnBiddulph 4 месяца назад
29:08, I have installed django-cors-headers and added to settings app and middleware, I am getting: No module named 'corsheaders' please help
@Two-su6by
@Two-su6by Месяц назад
thanks
@mehboobshaikh8396
@mehboobshaikh8396 2 года назад
can you make a video on how to integrate Django rest framework with Keycloak?
Далее
Вечный ДВИГАТЕЛЬ!⚙️ #shorts
00:27
Просмотров 2,5 млн
React JWT Authentication
41:06
Просмотров 92 тыс.
Angular JWT Authentication
33:50
Просмотров 71 тыс.
Django REST Framework - Build an API from Scratch
40:39
Django REST JWT authentication |  Simple JWT
14:41
Просмотров 35 тыс.
VueJS JWT Authentication
35:48
Просмотров 78 тыс.
FastAPI, Flask or Django - Which Should You Use?
9:49
Django Rest Framework | Serializers & CRUD
22:40
Просмотров 380 тыс.