Giter Club home page Giter Club logo

cognitojwt's People

Contributors

borisrozumnuk avatar dcalde avatar kevna avatar rangerthegood avatar revmischa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cognitojwt's Issues

cognitojwt has no attribute 'decode'

>>> import cognitojwt
>>>
>>> id_token = '<YOUR_TOKEN_HERE>'
>>> REGION = '**-****-*'
>>> USERPOOL_ID = 'eu-west-1_*******'
>>> APP_CLIENT_ID = '1p3*********'
>>>
>>> # Sync mode
>>> verified_claims: dict = cognitojwt.decode(
...     id_token,
...     REGION,
...     USERPOOL_ID,
...     app_client_id=APP_CLIENT_ID,  # Optional
...     testmode=True  # Disable token expiration check for testing purposes
... )
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'cognitojwt' has no attribute 'decode'
>>>

Module 'cognitojwt' has no attribute 'decode' when deploying on lambda

Hi,

I'm trying to use this on a lambda.

So I moved your package in a zip along with my function and uploaded.
image

Then my code is straightforward and works on my laptop - it's the same as the example:

import cognitojwt

id_token = '....'
REGION = 'us-east-2'
USERPOOL_ID = 'us-east-2_XXXX'
APP_CLIENT_ID = '5XXXXX'
verified_claims: dict = cognitojwt.decode(id_token,REGION,USERPOOL_ID, app_client_id=APP_CLIENT_ID, testmode=True)

print (verified_claims)`

However, when running to lambda i get
> "errorMessage": "module 'cognitojwt' has no attribute 'decode'",

I think this has to do with how when doing pip install cognitojwt**[sync]**, the [sync] makes something happens that is not reproduced by just moving the cognitojwt in a zip folder...

Any idea for me to investigate would be appreciated :)

When requests is not installed it gives wrong error messages.

I was getting AttributeError: module 'cognitojwt' has no attribute 'decode' but the actual issue was I didn't had requests installed.

try:
import requests
from .jwt_sync import decode
all.append('decode')
except ImportError:
pass

this explicit pass should be handled

Security vulnerability in `ecdsa`

cognitojwt depends on python-jose, which in turn depends on ecdsa.
The latter has a high level vulnerability: GHSA-wj6h-64fc-37mp

Seems like ecdsa is not going to fix the issue: GHSA-wj6h-64fc-37mp
And python-jose has not had updates for ages.

Is it possible to switch from using python-jose to any other, more frequently updated library?
For example, joserfc?

examples would help

Hi Boris,

Tried this out and got this back at python console:

dict
<class 'dict'>

I can't figure out how to query this class. please advise, and suggest you add some examples in the doc.

I cannot import it

Thank you for sharing. After installing it under a 3.6 venv :
I get this error:

In [1]: import cognitojwt                                                                                                                                              
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-763e27221cb4> in <module>
----> 1 import cognitojwt

~/projects/python/switch_ui_angular/venv/lib/python3.6/site-packages/cognitojwt/__init__.py in <module>
----> 1 from .async import decode_async
      2 from .cognito import decode
      3 from .exceptions import CognitoJWTException
      4 
      5 name = "cognitojwt"

~/projects/python/switch_ui_angular/venv/lib/python3.6/site-packages/cognitojwt/async.py in <module>
      6 from jose.utils import base64url_decode
      7 
----> 8 from . import PUBLIC_KEYS_URL_TEMPLATE
      9 from .exceptions import CognitoJWTException
     10 from .token_utils import get_unverified_headers, get_unverified_claims, check_expired, check_aud

ImportError: cannot import name 'PUBLIC_KEYS_URL_TEMPLATE'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.