1

I am facing a problem of invalid token. I am testing simple_jwt with django rest framework When i log on the endpoint of TokenObtainPairView i receive refresh and access token but when i verify that token on jwt.io, I have invalid signature. It is obvious that my simple_jwt deliver me the wrong token. I don't know where the problem come from. After research I am thinking may be I need to Change 'SIGNING_KEY': SECRET_KEY,but I don't know how. I mentioned that I am using the pure TokenObtainPairView whithout any customization. If someone can help me.

jps
  • 20,041
  • 15
  • 75
  • 79
Jules Betfien
  • 25
  • 2
  • 6
  • 2
    This question comes up frequently and in most cases it's just because you did not copy the secret or key into the key field on jwt.io. Without knowing the secret or key, the token can't be verified. See [jwt.io says Signature Verified even when key is not provided](https://stackoverflow.com/q/69862105) to learn how to do it the right way. – jps May 21 '22 at 20:43
  • have you meanwhile been able to verify your token on jwt.io? – jps May 23 '22 at 12:27

1 Answers1

0

I think you are getting a valid token. However, after placing the token into "jwt.io", you need to provide the "SECRET_KEY" under the "VERIFY SIGNATURE" section against "your-256-bit-secret".

After providing the "SECRET_KEY", your signature will get verified.

To get the "SECRET_KEY", go to your "settings.py" file and search "SECRET_KEY".