Trying to leverage Auth0 actions to add Application Metadata to the Token for M2M credentials
Using the following in the Actions to setCustomClaim but not sure what permissions needed to be set in the Auth0 Management API to return this information in the JWT.
The Application Metadata was setup with a key “testKey” and the Action used in M2M flow is below
/**
* Handler that will be called during the execution of a Client Credentials exchange.
*
* @param {Event} event - Details about client credentials grant request.
* @param {CredentialsExchangeAPI} api - Interface whose methods can be used to change the behavior of client credentials grant.
*/
exports.onExecuteCredentialsExchange = async (event, api) => {
api.accessToken.setCustomClaim('appData', event.client.metadata['testKey']);
};