I am using PyJWT to generate and validate JWT in Python. Running pypy3 v2.4.
Simply trying to encode
and decode
a JWT similar to the example in the GitHub repo. I am getting the following error when decoding:
decoded = jwt.decode(encoded, secret, algorithm='HS256')
File "/usr/local/site-packages/jwt/api_jwt.py", line 64, in decode
options, **kwargs)
File "/usr/local/site-packages/jwt/api_jws.py", line 115, in decode
key, algorithms)
File "/usr/local/site-packages/jwt/api_jws.py", line 177, in _verify_signature
if not alg_obj.verify(signing_input, key, signature):
File "/usr/local/site-packages/jwt/algorithms.py", line 138, in verify
return constant_time_compare(sig, self.sign(msg, key))
File "/usr/local/site-packages/jwt/compat.py", line 50, in constant_time_compare
result |= ord(x) ^ ord(y)
TypeError: ord() expected string of length 1, but int found
It's clear the error is generated from inside the module code.
Any idea what's causing this error?
Thanks