Configure the options.domain Field for an Azure Active Directory Enterprise Connection

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.

  1. Sign in to the Azure Portal.

  2. Go to Microsoft Entra ID.

  3. On the Overview page, locate and copy the Primary domain value (for example, <your-company.onmicrosoft.com>).

  4. Sign in to the Auth0 Dashboard.

  5. Choose Applications > APIs.

  6. Select the Auth0 Management API.

  7. Select the API Explorer tab.

  8. Click Copy Token to copy the test token that is automatically generated. This token has the required update:connections permission. NOTE: This token is valid for 24 hours and must be handled as a sensitive credential.

  9. In the Auth0 Dashboard, choose Authentication > Enterprise.

  10. Select the desired AAD connection.

  11. Copy the Connection ID from the browser's URL. The ID is the string of characters following /connections/ (for example, con_xxxxxxxxxxxxxxxx).

  12. Use an API platform or command-line tool to send a PATCH request to the Management API. Configure the request with the following information:

    • URLhttps://<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-Typeapplication/json

      • AuthorizationBearer <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.domain field accepts an array of strings.

Recommended content

No recommended content found...