Last active
October 10, 2020 03:55
-
-
Save mbrown3321/9f738e77e7ab04461c6f5d98745c8a31 to your computer and use it in GitHub Desktop.
This file contains 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
const express = require('express'); | |
const app = express(); | |
const jwt = require('express-jwt'); | |
const jwks = require('jwks-rsa'); | |
const jwtAuthz = require('express-jwt-authz'); | |
app.use(jwt({ | |
secret: jwks.expressJwtSecret({ | |
cache: true, | |
rateLimit: true, | |
jwksRequestsPerMinute: 25, | |
jwksUri: 'https://dev-gkawf0h0.us.auth0.com/.well-known/jwks.json' | |
}), | |
audience: 'https://auth0-nodejs-example', | |
issuer: 'https://dev-gkawf0h0.us.auth0.com/', | |
algorithms: ['RS256'] | |
})); | |
app.get('/secured', (req, res) => { | |
res.json({ success: true }); | |
}); | |
app.listen(8000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment