Getting service not enabled within domain when requesting an API token

I have enabled the Client Credentials grant type. I must be missing something simple. Any ideas?

{"method":"POST",
"url":"https://<domain>.auth0.com/oauth/token",
"headers":{"content-type":"application/json"},
"body":{"grant_type":"client_credentials",
  "audience":"https://<domain>.auth0.com/api/v2",
  "client_id":"stuff",
  "client_secret":"stuff"},
"json":true}

Response:
StatusCodeError: 403 - {"error":"access_denied","error_description":"Service not enabled within domain: https://<domain>.auth0.com/api/v2"}
9 Likes

Found the problem. I was missing the trailing “/” on the audience.

15 Likes

Glad you have figured this one out!