0

我正在尝试使用签名pyjwt

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

我收到了这个错误

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
4

1 回答 1

0

替换make_encrypted_tokenmake_signed_token

使 encrypted_token加密结束令牌,而 ES256 用于对令牌进行签名

于 2020-01-31T15:15:45.890 回答