Auth0 Home Blog Docs

Getting service not enabled within domain when requesting an API token

auth0
api

#1

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"}

#2

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