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

[QUESTION] Support for customizing default verification #147

Open bigen1925 opened 8 months ago

bigen1925 commented 8 months ago

Question Would it be acceptable to add a support for customizing default verification?


Thanks in advance for develop and maintenance this great library! This save me from many complex lines and common mistakes.

Btw, I use the emulator of cognito in local development environment (and real cognito in production). It works with container and in local endpoint (ex, http://localhost:9229).

I want to use aws-jwt-verify with it , but there are some issues.

I'm happy if I can handle these with aws-jwt-verify in some way.

There are some possible solutions, but I think most of those are more or less emulator-specific. For example,

So, I think well new feature is


I understand and agree that aws-jwt-verify should focus on real AWS services. This feature weaken security with wrong use so I'm wondering if it is acceptable.

On the other hand, many aws-sdk clients are basically support for customEndpoint and can use with several emulators. I would be happy if aws-jwt-verify can use with them :)


Versions Which version of aws-jwt-verify are you using? 4.0.0 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) 18.12.1 If Web browser, which web browser and which version of it are you using?

If using TypeScript, which version of TypeScript are you using? (Should be at least 4) 5.1.6

ottokruse commented 8 months ago

Valid request! Thanks for posting.

We need some time to research this and form an opinion. Thanks for your suggestions and ideas, that's very helpful.