title: Auth0 roles using Express 'No authorization token was found'
body: <p>Sup guys! I'm trying to implement Auth0 roles on my SPA, The login/log out functionallity works fine.But doesn't know how to add roles permissions ( the App its running at Heroku)...
  Here´s my app.js:</p>
  <pre><code>const express = require('express');
  const cookieParser = require('cookie-parser');
  const morgan = require('morgan');
  const routes = require('./routes/index.js');
  const cors = require('cors');
  const { auth, requiresAuth} = require('express-openid-connect');
  const jwt = require('express-jwt');
  const jwksRsa = require('jwks-rsa');
  const jwtAuthz = require('express-jwt-authz');
  
  
  require('./db.js');
  
  const server = express();
  
  server.name = 'API';
  
  const config = {
    authRequired: false,
    auth0Logout: true,
    baseURL:&quot;https://villatranquila.herokuapp.com/&quot; ,
    clientID: &quot;X0L9KdnZ9YanIX48y.......&quot;,
    issuerBaseURL:&quot;https://dev-2py8q024.us.auth0.com/&quot; ,
    secret:&quot;5a64dw6f5h4f64u6ft565eqa6wq65w4x..........&quot;
  };
  
  // auth router attaches /login, /logout, and /callback routes to the baseURL
  server.use(auth(config));
  
  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: `https://dev-2py8q024.us.auth0.com/.well-known/jwks.json`
    }),
  
    // Validate the audience and the issuer.
    audience: 'https://villatranquila.herokuapp.com/',
    issuer: `https://dev-2py8q024.us.auth0.com/`,
    algorithms: ['RS256']
  });
  
  // req.isAuthenticated is provided from the auth router
  server.get('/', (req, res) =&gt; {
    res.send(req.oidc.isAuthenticated() ? 'Logged in' : 'Logged out')
  });
  
  server.get('/profile', requiresAuth(),  (req, res) =&gt; {
    res.send(JSON.stringify(req.oidc.user));
  });
  
  server.get('/api/private', checkJwt, function(req, res) {
    res.json({
      message: 'Hello from a private endpoint! You need to be authenticated to see this.'
    });
  });
  
  const checkScopes = jwtAuthz([ 'admin:read' ]);
  
  server.get('/api/private-scoped', checkJwt, checkScopes, function(req, res) {
    res.json({
      message: 'Hello from a private endpoint! You need to be authenticated and have a scope of read:messages to see this.'
    });
  });
  
  server.use(checkJwt);
  
  server.use(express.urlencoded({ extended: true, limit: '50mb' }));
  server.use(express.json({ limit: '50mb' }));
  server.use(cookieParser());
  server.use(cors());
  server.use(morgan('dev'));
  server.use((req, res, next) =&gt; {
    res.header('Access-Control-Allow-Origin', '*'); // update to match the domain you will make the request from
    res.header('Access-Control-Allow-Credentials', 'true');
    res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept');
    res.header('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, DELETE');
    next();
  });
  
  server.use('/', routes);
  
  // Error catching endware.
  server.use((err, req, res, next) =&gt; { // eslint-disable-line no-unused-vars
    const status = err.status || 500;
    const message = err.message || err;
    console.error(err);
    res.status(status).send(message);
  });
  
  module.exports = server;
  
  </code></pre>
  <p>And here is the Heroku Application Logs ( App starts, I can get to non controlled routes, but when I try to reach controlled ones (/api/private or /api/private-scope ) i get &quot;No authorization token was found:&quot;</p>
  <pre><code>2021-09-30T19:51:58.170228+00:00 heroku[router]: at=info method=GET path=&quot;/api&quot; host=villatranquila.herokuapp.com request_id=70de01d2-4b18-4ede-94c0-f375b1f7d81e fwd=&quot;186.39.49.142&quot; dyno=web.1 connect=0ms service=2ms status=401 bytes=2159 protocol=https
  2021-09-30T19:51:58.169181+00:00 app[web.1]: UnauthorizedError: No authorization token was found
  2021-09-30T19:51:58.169192+00:00 app[web.1]:     at middleware (/app/node_modules/express-jwt/lib/index.js:79:21)
  2021-09-30T19:51:58.169193+00:00 app[web.1]:     at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
  2021-09-30T19:51:58.169193+00:00 app[web.1]:     at trim_prefix (/app/node_modules/express/lib/router/index.js:317:13)
  2021-09-30T19:51:58.169193+00:00 app[web.1]:     at /app/node_modules/express/lib/router/index.js:284:7
  2021-09-30T19:51:58.169194+00:00 app[web.1]:     at Function.process_params (/app/node_modules/express/lib/router/index.js:335:12)
  2021-09-30T19:51:58.169194+00:00 app[web.1]:     at next (/app/node_modules/express/lib/router/index.js:275:10)
  2021-09-30T19:51:58.169195+00:00 app[web.1]:     at /app/node_modules/express/lib/router/index.js:635:15
  2021-09-30T19:51:58.169195+00:00 app[web.1]:     at next (/app/node_modules/express/lib/router/index.js:260:14)
  2021-09-30T19:51:58.169195+00:00 app[web.1]:     at /app/node_modules/express-openid-connect/middleware/auth.js:38:5
  2021-09-30T19:51:58.169195+00:00 app[web.1]:     at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5) {
  2021-09-30T19:51:58.169196+00:00 app[web.1]:   code: 'credentials_required',
  2021-09-30T19:51:58.169197+00:00 app[web.1]:   status: 401,
  2021-09-30T19:51:58.169197+00:00 app[web.1]:   inner: { message: 'No authorization token was found' }
  2021-09-30T19:51:58.169197+00:00 app[web.1]: }
  </code></pre>
  <p>Can any one give me a hand here? Regards in advance!!!</p>