Giter Club home page Giter Club logo

Comments (2)

CatCanCreate avatar CatCanCreate commented on May 30, 2024

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 :)

except ImportError:

try to install requests (pip install requests)

from cognitojwt.

A1exandre avatar A1exandre commented on May 30, 2024

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)

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.