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.
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
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
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.
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
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?
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.
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
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
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!
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.
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.
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
You're indeed "Munir". You just shed LIGHT on this topic that has been haunting me for long time.
Thank you so much.
Token auth vs JWT auth - part is the best, thank you !
Bro thank you so much you made mt day lmao I thought JWT was so hardcore 😂🙏
Videos looks so easy to understand, thanks for what you do.
Thank you pabor! Plz spread the video by sharing. And don't forget to subscribe..:D
Great explanation easy to understand
Glad you think so!
Thank you,,,need more videos like ...
Great explaination man🙏
Appreciate it!
Please do djoser with email password login fields.. No username
Make such more videos man we need u
Thank you for your precious words.
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?
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
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.
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
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?
Hai,
After we saved this token in local storage how the backend know my token is stored in the local storage.
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.
WOWWWWWWWWWWW
Thank you for the content. How would you implement admin approval before users can login? Similar to registration redux.
Great video! ps next time, please close the windows during recording ;)
Thanks for the tip!
thanks for sharing
My pleasure.
Is it possible to log into django admin panel with this authentication method?
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
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
Hii. great video. Can you please tell how can i get other fields with simple-jwt token (eg. username, first_name, last_name)
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!
@@codeaura5138 thank you. I tried customising the token. But all I am getting is only the user id not the other fields
Thanks
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.
How you have resolved this issue?
please make password reset video
List of videos are coming soon. I will consider password resetting video too. Thank you.
could you give me your slide?
{
"detail": "No active account found with the given credentials"
}
Getting this error
@Surya Raj, it is not an error. Clearly, the credentials (username and password) that you have used are wrong.
@@codeaura5138 fixed it. 😊