1

I am trying to sign using pyjwt

key = jwk.JWK.from_pem(pkey_contents)
token = jwt.JWT(header={"alg": "ES256"},
                     claims=Token.serialize())
token.make_encrypted_token(key)

and I am getting this error

app_1         |   File "/usr/local/lib/python3.6/site-packages/jwcrypto/jwe.py", line 122, in _jwa_keymgmt
app_1         |     raise InvalidJWEOperation('Algorithm not allowed')
app_1         | jwcrypto.common.InvalidJWEOperation: Algorithm not allowed
Martin Thoma
  • 124,992
  • 159
  • 614
  • 958
wonton
  • 7,568
  • 9
  • 56
  • 93

1 Answers1

0

Replace make_encrypted_token with make_signed_token

Make encrypted_token encrypts the end token whereas ES256 is used to sign the token.

wonton
  • 7,568
  • 9
  • 56
  • 93