How to add these custom claims to the token
“https://test/entitlements”:
{
“email”: “jane@example.com”,
“email_verified”: true,
“user_id”: “custom|123”,
“favorite_color”: “blue”,
}
to this token using curl or Node JS
curl --request POST
–url https://test.com/oauth/token
–header ‘content-type: application/json’
–data ‘{“client_id”:“test”,“client_secret”:“test”,“audience”:“https://test.com/api/v2/",“grant_type”:"client_credentials”}’
or Node Js
var request = require(“request”);
var options = { method: ‘POST’,
url: ‘https://test.auth0.com/oauth/token’,
headers: { ‘content-type’: ‘application/json’ },
body: ‘{“client_id”:“test”,“client_secret”:“test”,“audience”:“https://test.auth0.com/api/v2/",“grant_type”:"client_credentials”}’ };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});