Comments (2)
Hi,
I'm trying to use this on a lambda.
So I moved your package in a zip along with my function and uploaded.
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 :)
cognitojwt/cognitojwt/__init__.py
Line 13 in 6a9b452
try to install requests (pip install requests)
from cognitojwt.
Yes - indeed.
OK so to recape & close:
- Problem was that I was missing some parts of the dependency tree of Requests (given I copied manually as I could not use pip in my environment)
- One reason was that cognitojwt/init.py was failing silently so I did not spot this
- Solution was quite obvious: install the package dependency properly (i.e. with all sub-dependencies)
Thanks!
from cognitojwt.
Related Issues (9)
- I cannot import it
- examples would help HOT 1
- Typo in the AWS_COGNITO_JWSK_PATH name? HOT 4
- Trying to use flask_jwt_extended.set_access_cookies giving error
- cognitojwt has no attribute 'decode' HOT 1
- Security vulnerability in `ecdsa` HOT 2
- When requests is not installed it gives wrong error messages. HOT 5
- ImportError: cannot import name 'decode_async' from 'cognitojwt' HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cognitojwt.