Giter VIP home page Giter VIP logo

Comments (7)

ghdna avatar ghdna commented on May 28, 2024 1

Oh that I can answer, since it relates to this package and not AWS Cognito. The default expiration time is 1 hour, as set by AWS Cognito. BUT should you want to have a shorter expiration time, say 5 minutes, you can set your own token expiration in CognitoExpress config.

from cognito-express.

burkeallen avatar burkeallen commented on May 28, 2024 1

Thank you

from cognito-express.

ghdna avatar ghdna commented on May 28, 2024

Yes, once the token expires, you get this error:

{
    "name": "TokenExpiredError",
    "message": "jwt expired",
    "expiredAt": "2017-07-05T16:41:59.000Z"
}

from cognito-express.

burkeallen avatar burkeallen commented on May 28, 2024

Thank you for the quick response, how is the expiration determined?

is it based on the actual "exp" value in the token? or is it based on the tokenExpiration value + the "auth_time" value in the token?

from cognito-express.

ghdna avatar ghdna commented on May 28, 2024

Bit rusty on the exact mechanics but I could point you to the official documentation on this to avoid giving false/outdated info: https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-using-tokens-with-identity-providers.html#amazon-cognito-user-pools-using-the-id-token

from cognito-express.

burkeallen avatar burkeallen commented on May 28, 2024

thanks, Cognito validates based on the exp value in the access token.

just wondering why "tokenExpiration" is something that gets set in the cognitoExpress Config, I guess I can dig into the code to find out for sure.

from cognito-express.

dushyant89 avatar dushyant89 commented on May 28, 2024

hey @ghdna thanks for building the library. I was hoping to read more on the part where we use the url .well-known/jwks.json to fetch some response and the data in the response lays the foundation for unpacking/decoding the jwt, this doesn't seem like standard public key cryptography, can you share some resources on the strategy used ?

from cognito-express.

Related Issues (20)

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.