I am doing reactjs-authentication-tutorial, the login process works fine however when I try to access Celebrity Jokes
browser console shows:GET http://localhost:3333/api/jokes/celebrity 401 (Unauthorized)
and server console UnauthorizedError: jwt malformed
.
I cloned the repo and filled in the required values so not sure what’s going wrong here.
server.js
const authCheck = jwt({
secret: jwks.expressJwtSecret({
cache: true,
rateLimit: true,
jwksRequestsPerMinute: 5,
// YOUR-AUTH0-DOMAIN name e.g https://prosper.auth0.com
jwksUri: 'https://nepherius.eu.auth0.com/.well-known/jwks.json'
}),
// This is the identifier we set when we created the API
audience: 'https://nepherius.eu.auth0.com/api/v2/',
issuer: 'nepherius.eu.auth0.com',
algorithms: 'RS256']
});
AuthService.js
const CLIENT_ID = 'pwawvou4hsdf7mnNJuMuV5Glx2a0Vz4X7imup';
const CLIENT_DOMAIN = 'nepherius.eu.auth0.com';
const REDIRECT = 'http://localhost:3000/callback';
const SCOPE = 'openid';
const AUDIENCE = 'https://nepherius.eu.auth0.com/userinfo';