Unauthorized"}curl: (6) Could not resolve host: application

I want to get the token for an API I am protecting via Auth0. Auth0 provides the code:

curl --request POST \
  --url https://xxx.eu.auth0.com/oauth/token \
  --header 'content-type: application/json' \
  --data '{"client_id":"xxx","client_secret":"xxx","audience":"xxx","grant_type":"client_credentials"}'

I have x’d out some values for privacy, but I get this error;

{“error”:“access_denied”,“error_description”:“Unauthorized”}curl: (6) Could not resolve host: application

Presumably the unresolved address is the audience, as this was a url that does not resolve from where I run the command from. What should the IP of that host name be? The server hosting the API I built?


Hi @GurdipS,

Welcome back to the Auth0 Community!

Are you by chance using a custom domain in your tenant? If so, are you referencing that custom domain in --url https://xxx.eu.auth0.com/oauth/token? Requests to the Management API are one of the few places where you’ll still want to use your canonical domain instead of your custom domain.

I hope this helps!