Here is the api check: const jwtCheck = auth({
audience: ‘h t t p s://myurl.com’,
issuerBaseURL: ‘https://me.eu.auth0.com/’,
tokenSigningAlg: ‘RS256’,
});
auth provider in index.js <Auth0Provider
domain=“me.eu.auth0.com”
clientId={{MY CLIENT ID}}
redirectUri={window.location.origin}
audience=“h t t p s://myurl.com”
>
And the front end getting the token and making the request const authLink = setContext(async (_, { headers }) => {
const token = await getAccessTokenSilently();
return {
headers: {
…headers,
Authorization: Bearer ${token},
},
};
});
const client = new ApolloClient({
link: authLink.concat(httpLink),
cache: new InMemoryCache(),
});
The token im sending is identical to the one the API is recieving
To add to this it appears that the access token is a JWE not a JWT token though there is nowhere i can set this and i havent changed any oauth settings so this should i believe default to JWT?
When you login to Auth0 and don’t specify an audience, you will get an opaque access token. It looks like a regular JWT, but actually it’s a self contained encrypted JWT. The only way to validate an opaque token is to call the server that issued the token, in this case the /userinfo endpoint.
In order to get an JWT. You need to create a custom api. Then use this as the audience in your react app to login: