awslabs / aws-jwt-verify

JS library for verifying JWTs signed by Amazon Cognito, and any OIDC-compatible IDP that signs JWTs with RS256, RS384, and RS512
Apache License 2.0
594 stars 43 forks source link

Not able to fetch jwks in node V20 #159

Open hbc19 opened 1 month ago

hbc19 commented 1 month ago

Question How can we help you? I am facing issue while fetching jwks from cognito in version 20 of nodejs. On version 16 and 20 it is working fine but gets timeout on 20. Any reasons why?

Error: FetchError: Failed to fetch https://cognito-idp.<region>.amazonaws.com/<userpool>/.well-known/jwks.json:

Note: I have replaced region with and userpool id with in above error.

Versions Which version of aws-jwt-verify are you using? 4.0.1 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 14) v20.11.0 If Web browser, which web browser and which version of it are you using? N.A. If using TypeScript, which version of TypeScript are you using? (Should be at least 4) 5.3.3

ottokruse commented 1 month ago

Should just work, have used the lib many times on Node.js 20 although maybe not your exact version. You can increase the response timeout (see README) to test if that solves it but it should just be fast and I suspect the issue is elsewhere (eg no internet). Can also try to make another http fetch call in your code and see if that does work.

ottokruse commented 4 days ago

How's this going @hbc19 ?