Created
December 16, 2021 21:11
-
-
Save rschwabco/b0e5ab9e422ade8d01105bcdf8e7ae35 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Paste after the dependencies | |
const checkJwt = jwt({ | |
// Dynamically provide a signing key based on the kid in the header and the signing keys provided by the JWKS endpoint | |
secret: jwksRsa.expressJwtSecret({ | |
cache: true, | |
rateLimit: true, | |
jwksRequestsPerMinute: 5, | |
jwksUri: process.env.JWKS_URI, | |
}), | |
// Validate the audience and the issuer | |
audience: process.env.AUDIENCE, | |
issuer: process.env.ISSUER, | |
algorithms: ["RS256"], | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment