Auth0 "Service not enabled within domain" Error When Using an Audience Parameter
Last Updated:
Overview
An Auth0 error occurs when making an API call that specifies an incorrect audience parameter. This happens when setting the audience parameter to a custom domain instead of the default tenant domain when requesting a token for the Management API. Resolve this by configuring the audience parameter to match the Management API identifier displayed in the Auth0 Dashboard.
Service not enabled within domain
Applies To
- Auth0
- API Calls
- Audience Parameter
Cause
This error occurs when setting the audience parameter to https://<CompanyCustomDomain>/api/v2/ instead of https://<CompanyDefaultTenantDomain>/api/v2/ when requesting a token for the Management API.
Solution
How is the audience parameter configured?
The API identifier for the Management API uses the default tenant domain. Configure the audience parameter to match the Management API identifier displayed in the Auth0 Dashboard by navigating to the APIs section.
- Navigate to Applications and choose APIs.
- Locate the Management API identifier.
- Configure the audience parameter to match the identifier.
audience: https://<CompanyDefaultTenantDomain>/api/v2/