How can i get user login details from auth token is it possible

38 views
Skip to first unread message

yashwanth balanagu

unread,
Aug 28, 2020, 3:09:44 PM8/28/20
to Django REST framework
After Registration and login i was created the auth token for login authentication through api 

user auth token  :- e3b026312e366c5005cc90a3bbbb6bfb430a2aa2,
generated by backend after login from frontend using django rest login api's

Yezileli Ilomo

unread,
Aug 28, 2020, 3:28:36 PM8/28/20
to django-res...@googlegroups.com
Why don't you return user info along with the token when logging in or singing up.

--
You received this message because you are subscribed to the Google Groups "Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-fram...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-rest-framework/51908865-3a8a-4e68-bc76-1ee6fd6e3a55n%40googlegroups.com.

yashwanth balanagu

unread,
Aug 29, 2020, 12:58:13 AM8/29/20
to Django REST framework
To show in the user details in home page

Carl Nobile

unread,
Aug 30, 2020, 10:50:15 AM8/30/20
to django-res...@googlegroups.com
It depends on the type of token you user JWT (JSON Web Token) are the most comment types to use when needed additional user details, however, you must be using OAuth2 to use these. DRF \'s internal token system cannot use JWT tokens.




--
-------------------------------------------------------------------------------
Carl J. Nobile (Software Engineer)
carl....@gmail.com
-------------------------------------------------------------------------------

naveen Kumar

unread,
Aug 30, 2020, 11:52:02 AM8/30/20
to django-res...@googlegroups.com
Just go to table ' auth_tokens ' there you can see a foreign key  ' user_id  '  linking to users table.

So using auth_token you can get the record from auth_tokens table where u can retrieve user_id I think you got from here what to do....

--
Reply all
Reply to author
Forward
0 new messages