awslabs/aws-support-tools

[JOSE] Issues with cognito decode and verify from AWS support tools

Quamber opened this issue · 1 comments

Issues with a package in example:

https://github.com/awslabs/aws-support-tools/blob/master/Cognito/decode-verify-jwt/decode-verify-jwt.py

Traceback (most recent call last):

File "/Users/username/opt/anaconda3/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3437, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)

File "", line 4, in
from jose import jwk, jwt

File "/Users/username/opt/anaconda3/lib/python3.8/site-packages/jose.py", line 546
print decrypt(deserialize_compact(jwt), {'k':key},
^
SyntaxError: invalid syntax

Install python-jose in your workspace.

pip install python-jose

If you're using AWS lambda, upload the dependencies along with your zip file bundle.

https://docs.aws.amazon.com/lambda/latest/dg/python-package.html#python-package-create-package-with-dependency