I have been trying to access resources on server side but I keep getting UnauthorizedError: jwt malformed as an Error. I’ve followed a previous topic and many users suggested that the audience value from the guide is wrong. The audience given in the guide is https:///userinfo but it should be ‘https://.auth0.com/api/v2/’, I’ve made that change and the error is still there.
const checkJwt = jwt({ secret: jwksRsa.expressJwtSecret({ cache: true, rateLimit: true, jwksRequestsPerMinute: 5, jwksUri: `https://<domain>/.well-known/jwks.json` }), // Validate the audience and the issuer. audience: "https://<something>/api/v2/", issuer: `https://<something>/`, algorithms: ["RS256"] });
This is my server side code and i’ve changed all the values.
On my frontend, this is my code
this.auth0 = new auth0.WebAuth({ // the following three lines MUST be updated domain: "<Domain>", audience: "https://<Something>/api/v2/", clientID: "clientID", redirectUri: "http://localhost:3000/callback", responseType: "token", scope: "openid" });
Can someone please tell me where im going wrong and how to fix it?