Closed zemanel closed 6 years ago
I'm having the same issue.
Instead of 'JWT_ALGORITHM': 'HS256'
put 'JWT_ALGORITHM': 'RS256'
.
edit: See https://stackoverflow.com/questions/39239051/rs256-vs-hs256-whats-the-difference
@brussee i changed the algorithm at the time to 'RS256' and worked perfectly, thanks
I'm utilising
django-rest-framework-jwt
for an REST API authentication and i'd like to have the same web token authorize access to another http service (couchdb).For creating a JWT enabled reverse proxy i'm looking at jwtproxy (https://github.com/coreos/jwtproxy) which 8afaik) can use a preshared RSA key, so i'm trying to configure RSA private/public keys on
django-rest-framework-jwt
.Docs mention
JWT_PUBLIC_KEY
is an object of type cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicKey and i'm utilisingcryptography
to try and load an private key file (https://github.com/coreos/jwtproxy/blob/master/examples/httpserver/mykey.key):But i get an error about key not being a string type
If i convert the key objet to bytes:
i get an exception about the key format:
Could i get a nudge in the right direction on how to set proper values for JWT_PRIVATE_KEY/JWT_PUBLIC_KEY from a RSA key ?