Configure the options.domain Field for an Azure Active Directory Enterprise Connection
Last Updated:
Overview
This article provides instructions on how to add a value to the options.domain field for an existing Microsoft Azure Active Directory (AAD) enterprise connection by using the Management API.
Applies To
-
Auth0
-
Enterprise Connections
-
Microsoft Azure Active Directory
-
Management API
Cause
-
Auth0
-
Enterprise Connections
-
Microsoft Azure Active Directory
-
Management API
Solution
This process involves locating the AAD tenant domain, obtaining an Auth0 Management API token, and sending an API request to update the connection.
-
Sign in to the Azure Portal.
-
Go to Microsoft Entra ID.
-
On the Overview page, locate and copy the Primary domain value (for example,
<your-company.onmicrosoft.com>). -
Sign in to the Auth0 Dashboard.
-
Choose Applications > APIs.
-
Select the Auth0 Management API.
-
Select the API Explorer tab.
-
Click Copy Token to copy the test token that is automatically generated. This token has the required
update:connectionspermission. NOTE: This token is valid for 24 hours and must be handled as a sensitive credential. -
In the Auth0 Dashboard, choose Authentication > Enterprise.
-
Select the desired AAD connection.
-
Copy the Connection ID from the browser's URL. The ID is the string of characters following
/connections/(for example,con_xxxxxxxxxxxxxxxx). -
Use an API platform or command-line tool to send a
PATCHrequest to the Management API. Configure the request with the following information:-
URL:
https://<AUTH0_DOMAIN>/api/v2/connections/<CONNECTION_ID>-
Replace
<AUTH0_DOMAIN>with the Auth0 tenant domain. -
Replace
<CONNECTION_ID>with the ID copied in the previous step.
-
-
Headers:
-
Content-Type:application/json -
Authorization:Bearer <MGMT_API_TOKEN> -
Replace
<MGMT_API_TOKEN>with the token copied from the API Explorer.
-
-
Body: The body must be a JSON object that specifies the domain to add. The
options.domainfield accepts an array of strings.
-