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
Replace
make_encrypted_token
withmake_signed_token
Make encrypted_token encrypts the end token whereas ES256 is used to sign the token.