GehirnInc/python-jwt

TypeError: _EllipticCurvePublicKey.verify() takes 4 positional arguments but 5 were given

cemysf opened this issue · 1 comments

Trying to decode a jwt token which was encrypted with RS256

res = jwt.decode(
    jwt=token,
    key=SECRET,
    algorithms=["ES256","RS256",],
    options={
        "verify_signature": True,
        "require": get_required_fields(),
    }
)

getting this error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/venv/lib/python3.10/site-packages/jwt/api_jwt.py", line 168, in decode
    decoded = self.decode_complete(
  File "/opt/venv/lib/python3.10/site-packages/jwt/api_jwt.py", line 120, in decode_complete
    decoded = api_jws.decode_complete(
  File "/opt/venv/lib/python3.10/site-packages/jwt/api_jws.py", line 202, in decode_complete
    self._verify_signature(signing_input, header, signature, key, algorithms)
  File "/opt/venv/lib/python3.10/site-packages/jwt/api_jws.py", line 300, in _verify_signature
    if not alg_obj.verify(signing_input, key, signature):
  File "/opt/venv/lib/python3.10/site-packages/jwt/algorithms.py", line 377, in verify
    key.verify(sig, msg, padding.PKCS1v15(), self.hash_alg())
TypeError: _EllipticCurvePublicKey.verify() takes 4 positional arguments but 5 were given

versions:

# pip freeze | grep JWT
PyJWT==2.6.0
# pip freeze | grep cryptography
cryptography==38.0.3

sorry wrong repo