jpadilla / django-rest-framework-jwt

JSON Web Token Authentication support for Django REST Framework
http://jpadilla.github.io/django-rest-framework-jwt/
MIT License
3.19k stars 650 forks source link

Error decoding signature when created via admin interface #431

Open Arti3DPlayer opened 6 years ago

Arti3DPlayer commented 6 years ago

I created a token via admin interface.

screen shot 2018-03-28 at 12 18 33

Then do:

curl "http://0.0.0.0:8000/projects/" -H "Authorization: JWT 37fd60be49932a418aba5f9f12d39891b78acf0b" And receive error:

{"detail":"Error decoding signature."}

gmdzy2010 commented 6 years ago

What I notice that you store the token in database, but how about the session? the token generator generate responding token with the user object "admin", but each request owns an unique sessionid, so I think the token stored into the database is session-related, that is, these lead to that error above.

I hope this is the reason, or anyone else knows the fact?

Arti3DPlayer commented 6 years ago

token stored into the database is session-related

What does that mean ? That I can only use this token in session with which I created it ?