Search code examples
oauth-2.0auth0azure-api-management

Specify audience parameter in Azure API Management Oauth2 Service


I'm trying to set up an Oauth2 authentication service in Azure API Management in order to authenticate users in our Auth0 identity provider in the Developer Portal.
However I'm not able to configure the Oauth2 service to pass the audience parameter in order to get a JWT-token (now only an Opaque token is returned).

I've create a new Oath2 service in the Azure portal, with specified audience in the "Additional body parameters" section:

enter image description here

Next, I've added the Oath2 Service to the API:

enter image description here

Next, when I try to test the API in the developer portal I'm only getting an Opaque token:

enter image description here

I would expect that audience would be included when specified in the "Additional parameters" section, but that does not seem to be working.
So I wonder if it's something I'm doing wrong here.


Solution

  • Our solution to this problem was to set the "Default Audience" under "Settings" in Auth0:

    enter image description here

    This way, Auth0 will use the Default Audience as a fallback when no audience is supplied in the request.