Implement JWT on django rest platform with Auth0

I am trying to implement JWT authentication in the Django REST api framework, but I have problems decoding the signature of the token coming from Auth0. I am using the package djangorestframework-jwt. In the settings I installed django credentials JWT_SECRET_KEYand JWT_AUDIENCEin my Auth0, and tried to use the decoded version key64 key ( Auth0claims that the secret key is encoded by default). I can successfully decode one of the incoming tokens with an online tool like jwt.io, and I can even decode the token in the terminal using

jwt.decode( token, base64.b64decode(JWT_SECRET_KEY.replace("_","/").replace("-","+")), JWT_AUDIENCE) 

but for some reason, when I try to allow the djangorestframework-jwttoken to be decoded, I get an error decoding the signature every time. I understand that this may be too specific a question, but hopefully someone who dealt with this stack could give me a hand.

+4
source share

All Articles