Auth0 Service Not Enabled Within Domain Error When Using an Audience Parameter
This article explains the cause of the following error, which occurs when making an API call that specifies an incorrect audience parameter.
Service not enabled within domain
- API Calls
- Audience Parameter
This error is caused by setting the audience parameter to https://{yourCustomDomain}/api/v2/ instead of https://{yourDefaultTenantDomain}/api/v2/ when requesting a token for the Management APIv2.
The API identifier for the Management APIv2 uses the default tenant domain. To resolve this error, configure the audience parameter to match the Management APIv2 identifier displayed in the Dashboard under Applications > APIs.
For example:
audience: https://{yourDefaultTenantDomain}/api/v2/