Skip to content

Error: Failed to fetch https://cognito-idp.sa-east-1.amazonaws.com/<POOL_ID>/.well-known/jwks.json in Next.js app at server side. #229

@naveensgs

Description

@naveensgs

Question
I am using steps provided here in the Next.js project to verify JWT token. I always end up with this (Attached screenshot) error. It works once in a while and fails most of the case in local development. But when the app is deployed in AWS it just works fine without any error. I did increase timeout, wrote a custom methods to decode token and did test it using curl command everything just works fine except in node.js app. Please help if there is any fix or configuration i need to do in cognito dashboard.

Image

Versions
Which version of aws-jwt-verify are you using? Latest
Are you using the library in Node.js or in the Web browser? Node.js
If Node.js, which version of Node.js are you using? (Should be at least 18) 22.16
If Web browser, which web browser and which version of it are you using? None
If using TypeScript, which version of TypeScript are you using? (Should be at least 4) 5

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions