Hi all!
I’m new at oauth and facing a problem than can’t figure out how to fix. In my production environment, i’m getting “Access token not exists” error when try a POST to oauth/token endpoint.
My source code:
var rp = require('request-promise');
var options = { method: 'POST',
url: 'https://playmojo.eu.auth0.com/oauth/token',
headers: { 'content-type': 'application/json' },
body: {
client_id : <CLIENT_ID>,
client_secret : <CLIENT_SECRET>,
audience: 'https://playmojo.eu.auth0.com/api/v2/',
grant_type : 'client_credentials'
}
};
try {
const response = await rp(options);
console.log('getToken OK: ' + response);
return response;
} catch (error) {
console.log('getToken error: ' + error);
return {error:true, message:error};
}
Any help will be appreciated.
Thanks in advance,
Antonio.