Hello,
I built a basic api with nodeJS to test the token verification capabilities.
Here is the code
`const express = require(“express”);
const { auth } = require(“express-oauth2-jwt-bearer”);
const jwtCheck = auth({
audience: ‘https://m2m.com’,
issuerBaseURL: ‘https://xxxx.auth0app.com/’,
tokenSigningAlg: ‘RS256’
});
const app = express()
app.get(“/public”, (req, res) => {
const message = “I am public”;
res.status(200).json(message);
});
app.get(“/protected”, jwtCheck,(req, res) => {
const message = “I am protected”;
res.status(200).json(message);
});
app.get(“/admin”, jwtCheck, (req, res) => {
const message = “I am an admin”;
res.status(200).json(message);
});`
When I try hitting /admin or /protected in postman with in the header ‘authorization: Bearer {{access_toke}}’, I get InvalidTokenError: Failed to fetch authorization server metadata
Why is that?