I’ve read every topic on this error and nothing has helped. Specifically:
I’m not using dd-trace, a package that some said caused the problem
I’m not prefixing my domain with a protocol
My credentials are correct
One thing I would like to confirm is where I should get my client ID and secret from. I’m currently getting them from Applications > API Explorer Application. I assume I don’t need to do anything else with this built-in application in order to be able to use the management API. Under “APIs” the management API is listed, and it is authorised.
I am hosted on Cloudflare Workers.
Have I no option but to use the REST API rather than the Node SDK?
Thanks for posting your question on the community!
Have you also tried initializing the management client using the API token of the Management API?
import { ManagementClient } from 'auth0';
var management = new ManagementClient({
domain: '{YOUR_TENANT_AND REGION}.auth0.com',
token: '{YOUR_API_V2_TOKEN}',
});
Also, as far as I know regarding the NodeJS, the clientID and clientSecret parameters should be populated with the values from a M2M application used by your application to communicate with the Management API.
Let me know if you have any other questions or updates!
Thanks for your reply. I will try the token approach you suggest, but is there any reason the client/secret approach shouldn’t work? The docs suggest it should.
The API Explorer is an M2M - it’s auto-created by Auth0, so I figured this was the place to get the client/secret from.
Indeed, by using the API Explorer application credentials or a different M2M application, you should be able to initialize the management client. I have advised you to initialize it using the token in order to inspect the behaviour and see if it would succeed.
Do you have any other updates on the matter? Were you able to initialize the client?