st4lk / django-rest-social-auth

OAuth signin with django rest framework
MIT License
522 stars 122 forks source link

JWT token is not valid #117

Closed zugspitze closed 4 years ago

zugspitze commented 4 years ago

Thanks a lot for this awesome package :-)

I am trying to run the example project with JWT auth, and I get the following JWT payload:

{
  "token_type": "access",
  "exp": <exp>,
  "jti": "<jti>",
  "user_id": <user_id>,
  "username": "<username>",
  "first_name": "<first_name>",
  "last_name": "<last_name>",
  "email": "<email>",
  "social_thumb": "<social_thumb>"
}

However, I don't see JWT token. I was wondering how can I get the JWT token. Can you please provide some help?

Thanks!

zugspitze commented 4 years ago

Sorry, I found the token in the response.

zugspitze commented 4 years ago

I need to reopen it again as the signature on the JWT token isn't valid according to https://jwt.io/

zugspitze commented 4 years ago

@st4lk can you please help?

st4lk commented 4 years ago

Hello Amit, thank you for your interest in the project!

I'll try to take a look at this soon. But generally speaking, the current package doesn't generate JWT tokens by itself, it just uses django-rest-framework-simplejwt for it.

It is possible that we use it in incorrect way, but I can't find an obvious error after quick check.

Maybe it is related to TokenVerifyView:

You can also include a route for Simple JWT's TokenVerifyView if you wish to allow API users to verify HMAC-signed tokens without having access to your signing key:

https://github.com/davesque/django-rest-framework-simplejwt#installation

zugspitze commented 4 years ago

Thanks @st4lk for the hint. I will include the verification view and see if it's valid.