We are developing an API (registered in Auth0’s dashboard), and we need to be able to create users in the Dashboard. For this we want to use the Management API.
We have a Machine to Machine application created and configured to use that API. We use the Auth0 client for Node backend, and when creating an instance of the ManagementClient like this:
var auth0 = new ManagementClient({
domain: '{YOUR_ACCOUNT}.auth0.com',
clientId: '{YOUR_NON_INTERACTIVE_CLIENT_ID}',
clientSecret: '{YOUR_NON_INTERACTIVE_CLIENT_SECRET}'
});
We get the error that ‘You need to create a “client-grant” associated to this API’. I don’t see where we need to create that grant.
I ended up solving this. The docs weren’t exactly clear about which API I was meant to set up for Machine to Machine, it was an API that had to be authorized with the Management API, which again, isn’t clear in the Dashboard how to configure it.
In the section titled “3. Select the API you want to be able to call from your application.”, you should select the Management API if that is the API you are trying to make requests to.