Django REST JWT authentication | Simple JWT

  Рет қаралды 37,304

Code Aura

Code Aura

Күн бұрын

Django REST JWT authentication | Simple JWT
Django rest framework authentication # Simple JWT
In this video, I will take you through Django Simple JWT Token Authentication with the Django rest framework. I have also illustrated the difference among Basic authentication, Token authentication and Simple JWT authentication of Django REST framework.

Пікірлер: 44
@benjaminandoh8524
@benjaminandoh8524 3 жыл бұрын
great work .... can you please make a tutorial of the simple_jwt that implements the serializer and the view. eg. retuning the user info and the tokens as well.
@codeaura5138
@codeaura5138 3 жыл бұрын
In case, you are using 'simple-jwt' for your system, you can retrieve 'access_token' and 'user' concurrently. You have to override 'TokenObtainPairSerializer' and 'TokenObtainPairView' though for your user and 'custom_claims'. Check the following link for details. django-rest-framework-simplejwt.readthedocs.io/en/latest/customizing_token_claims.html
@AkramKhan-lg1lr
@AkramKhan-lg1lr 3 жыл бұрын
Token auth vs JWT auth - part is the best, thank you !
@geoafrikana
@geoafrikana 2 жыл бұрын
You're indeed "Munir". You just shed LIGHT on this topic that has been haunting me for long time. Thank you so much.
@alex.yelisieiev
@alex.yelisieiev Ай бұрын
Bro thank you so much you made mt day lmao I thought JWT was so hardcore 😂🙏
@ramerlacida4737
@ramerlacida4737 8 ай бұрын
so every user need to go to postman to get the token? should we raise another form for user to enter that token to validate the login?
@laxmikantadahal4734
@laxmikantadahal4734 Жыл бұрын
Great explanation easy to understand
@codeaura5138
@codeaura5138 Жыл бұрын
Glad you think so!
@tolulopeayemobola1446
@tolulopeayemobola1446 3 жыл бұрын
Please do djoser with email password login fields.. No username
@abubakarshf
@abubakarshf 2 жыл бұрын
Hi I generated the new Token it is working perfectly. Now when I am including this Token in LoginView then it is not validating. Is there any best way to send this Token to the frontend by including in header or if we can update the previous Token by new Token in Login View. I am not getting that how to work with Django REST Framework default authtoken. Please guide me what is the standard process of using Token Based Authentication.
@Ab-gf8pz
@Ab-gf8pz 2 жыл бұрын
How you have resolved this issue?
@jintuthomas6947
@jintuthomas6947 Жыл бұрын
Hi, i have a doubt. Suppose a user A generated a access token, and using that access token he is excuted User_details api. And again he generated new access tokn using api and executed user_details api. Then he can execute that user details api with old access token and new access token at same time...how we can prevent this scenario... A user can access api using only one token at a time.... Can you help me to do this?
@jhoanmartinezsilva2609
@jhoanmartinezsilva2609 3 жыл бұрын
do i need the two auth urls from djoser to make it work simple jwt? i am getting the error, "detail": "No active account found with the given credentials" the password is hashed and is active
@codeaura5138
@codeaura5138 3 жыл бұрын
Djoser is optional. It completely depends on you if you want djoser in your project or not. Please, check your credentials properly as it is referring that your credentials are wrong or give me your project (git-hub) link. Probably I can help then.
@tusharimaran9748
@tusharimaran9748 3 жыл бұрын
Thank you,,,need more videos like ...
@meddahmadjid4284
@meddahmadjid4284 Жыл бұрын
if you can provide the functions of get_user_detail, cause i have probleme with authentification with access token and i want to know how the funtion was implemented just to compare with my code, please if u can share the code in the description, thank u
@paborlouise319
@paborlouise319 2 жыл бұрын
Videos looks so easy to understand, thanks for what you do.
@codeaura5138
@codeaura5138 2 жыл бұрын
Thank you pabor! Plz spread the video by sharing. And don't forget to subscribe..:D
@vinodraj4951
@vinodraj4951 3 жыл бұрын
Hai, After we saved this token in local storage how the backend know my token is stored in the local storage.
@codeaura5138
@codeaura5138 3 жыл бұрын
Are you using React or Angular as front end? Each time you send a request to server, you bind this 'token' with your header inside 'Authorization' segment. It would look like the following for sending request from JAVASCRIPT: headers: { 'Authorization': 'Bearer your_token' }, NOTE: your backend does not have to necessarily know that you have saved it into local-storage or not.
@yasayah7289
@yasayah7289 2 жыл бұрын
Thank you for the content. How would you implement admin approval before users can login? Similar to registration redux.
@alexanderp7521
@alexanderp7521 3 жыл бұрын
Is it possible to log into django admin panel with this authentication method?
@aakashbhaikatti2823
@aakashbhaikatti2823 3 жыл бұрын
Hii. great video. Can you please tell how can i get other fields with simple-jwt token (eg. username, first_name, last_name)
@codeaura5138
@codeaura5138 3 жыл бұрын
Hello Aakash Bhaikatti, In case, you are using 'simple-jwt' for your system, you can retrieve 'access_token' and 'user' concurrently. You have to override 'TokenObtainPairSerializer' and 'TokenObtainPairView' though for your user and 'custom_claims'. Check the following link for details. django-rest-framework-simplejwt.readthedocs.io/en/latest/customizing_token_claims.html Hope this helps! Let me know if you managed to do it. BTW, My Django-Rest-Tutorial is coming! You may subscribe to my channel and follow along...Happy Coding Brother!
@aakashbhaikatti2823
@aakashbhaikatti2823 3 жыл бұрын
@@codeaura5138 thank you. I tried customising the token. But all I am getting is only the user id not the other fields
@baetraki7268
@baetraki7268 3 жыл бұрын
how did you get the user, I think some kind of function that takes the access_token and responds with a user, can you provide the Github link or smth please
@codeaura5138
@codeaura5138 3 жыл бұрын
In case, you are using 'simple-jwt' for your system, you can retrieve 'access_token' and 'user' concurrently. You have to override 'TokenObtainPairSerializer' and 'TokenObtainPairView' though for your user and 'custom_claims'. Check the following link for details. django-rest-framework-simplejwt.readthedocs.io/en/latest/customizing_token_claims.html
@ViralAgrawal12321
@ViralAgrawal12321 3 жыл бұрын
Great explaination man🙏
@codeaura5138
@codeaura5138 3 жыл бұрын
Appreciate it!
@ViralAgrawal12321
@ViralAgrawal12321 3 жыл бұрын
Make such more videos man we need u
@codeaura5138
@codeaura5138 3 жыл бұрын
Thank you for your precious words.
@szymonslominski8830
@szymonslominski8830 3 жыл бұрын
Great video! ps next time, please close the windows during recording ;)
@codeaura5138
@codeaura5138 3 жыл бұрын
Thanks for the tip!
@zetalivsanns5360
@zetalivsanns5360 8 ай бұрын
Thanks
@srujangowda8490
@srujangowda8490 3 жыл бұрын
WOWWWWWWWWWWW
@onlygodovbije6701
@onlygodovbije6701 3 жыл бұрын
thanks for sharing
@codeaura5138
@codeaura5138 3 жыл бұрын
My pleasure.
@suryaraj93
@suryaraj93 3 жыл бұрын
{ "detail": "No active account found with the given credentials" } Getting this error
@codeaura5138
@codeaura5138 3 жыл бұрын
@Surya Raj, it is not an error. Clearly, the credentials (username and password) that you have used are wrong.
@suryaraj93
@suryaraj93 3 жыл бұрын
@@codeaura5138 fixed it. 😊
@amalsankar1538
@amalsankar1538 3 жыл бұрын
please make password reset video
@codeaura5138
@codeaura5138 3 жыл бұрын
List of videos are coming soon. I will consider password resetting video too. Thank you.
@meoconhoccode
@meoconhoccode Жыл бұрын
could you give me your slide?
What Is JWT and Why Should You Use JWT
14:53
Web Dev Simplified
Рет қаралды 1,2 МЛН
啊?就这么水灵灵的穿上了?
00:18
一航1
Рет қаралды 50 МЛН
😜 #aminkavitaminka #aminokka #аминкавитаминка
00:14
Аминка Витаминка
Рет қаралды 491 М.
РОДИТЕЛИ НА ШКОЛЬНОМ ПРАЗДНИКЕ
01:00
SIDELNIKOVVV
Рет қаралды 3,8 МЛН
How do Cats Eat Watermelon? 🍉
00:21
One More
Рет қаралды 14 МЛН
[KEYNOTE] Formlabs Fall 2024 Product Announcement
45:46
Formlabs
Рет қаралды 893
Django JWT Authentication in 7 Minutes
7:18
Tenacity
Рет қаралды 1,6 М.
Django API Authentication using JWT Tokens
37:06
Scalable Scripts
Рет қаралды 185 М.
Authentication & Refreshing Tokens Implementation
2:09:53
Dennis Ivy
Рет қаралды 238 М.
Django REST Framework Autenticación con Tokens
27:30
Fazt Code
Рет қаралды 16 М.
啊?就这么水灵灵的穿上了?
00:18
一航1
Рет қаралды 50 МЛН