I have the following basically matching the example…
var express = require('express');
var app = express();
var jwt = require('express-jwt');
var jwks = require('jwks-rsa');
var port = process.env.PORT || 8080;
const checkJwt = jwt({
secret: jwks.expressJwtSecret({
cache: true,
rateLimit: true,
jwksRequestsPerMinute: 5,
jwksUri: `https://.../.well-known/jwks.json`
}),
audience: 'https://...',
issuer: [`https://.../`],
algorithms: ['RS256']
}).unless({path: ['/']});
app.use(checkJwt)
app.get('/', function (req, res) {
res.send('Clear');
});
app.get('/authorized', function (req, res) {
res.send('Secured Resource');
});
app.listen(port);
But when I try going to http://localhost:8080/authorized I get…
UnauthorizedError: No authorization token was found
at middleware (/Users/.../Code/tmp/auth0/node_modules/express-jwt/lib/index.js:79:21)
at /Users/.../Code/tmp/auth0/node_modules/express-unless/index.js:47:5
at Layer.handle [as handle_request] (/Users/.../Code/tmp/auth0/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/Users/.../Code/tmp/auth0/node_modules/express/lib/router/index.js:317:13)
at /Users/.../Code/tmp/auth0/node_modules/express/lib/router/index.js:284:7
What am I missing?