Auth0 Azure Entra Connection Fails With an "AADSTS900023" Tenant Identifier Error

Overview

An Auth0 Azure Entra Enterprise connection returns a tenant identifier error when the configuration is missing the required domain and tenant domain attributes. Administrators resolve this issue by reviewing and updating the connection configuration via the Auth0 Management API. When an administrator configures an Azure Entra Enterprise connection manually or via the Deploy Command Line Interface (CLI) without these attributes, Auth0 returns an authentication error.

 

AADSTS900023: Specified tenant identifier 'undefined' is neither a valid DNS name, nor a valid external domain.

 

Applies To

  • Auth0
  • Azure/Entra Connection
  • Enterprise Connections

Cause

The login request contains malformed data and cannot match an existing authentication endpoint or instance. In an Auth0 configuration, this error occurs when the connection lacks the domain and tenant_domain attributes.

Review the following example of a non-working connection configuration.

{
  "id": "con_identifier",
  "options": {
    "domain": "acme.com",
    "client_id": "client-id",
    "use_wsfed": false,
    "ext_groups": true,
    "ext_profile": true,
    "identity_api": "microsoft-identity-platform-v2.0",
    "basic_profile": false,
    "waad_protocol": "openid-connect",
    "domain_aliases": [
      "acme.com"
    ],
    "api_enable_users": false,
    "ext_nested_groups": false,
    "useCommonEndpoint": false,
    "max_groups_to_retrieve": "500",
    "should_trust_email_verified_connection": "always_set_emails_as_verified"
  },
  "strategy": "waad",
  "name": "connection-name",
  "is_domain_connection": false,
  "show_as_button": false,
  "enabled_clients": [
    "client1",
    "client2",
    "client3"
  ],
  "realms": [
    "connection-name"
  ]
}

Solution

What steps are required to resolve an Azure Entra connection misconfiguration?

Review and update the Azure Entra connection configuration via the Auth0 Management API by performing the following actions.

  1. Call the Auth0 Management API connections endpoint to view the JSON object representing the connection.
  2. Verify that the domain and tenant_domain attributes exist in the configuration.
  3. Update the connection configuration to include the missing attributes.

NOTE: When updating the options object of a connection, include all pre-existing values along with any new values. Auth0 drops any omitted values during the update.

Review the following example of a working connection configuration.

{
  "id": "con_identifier",
  "options": {
    "domain": "company.com",
    "client_id": "client-id",
    "use_wsfed": false,
    "ext_groups": true,
    "ext_profile": true,
    "identity_api": "microsoft-identity-platform-v2.0",
    "basic_profile": false,
    "tenant_domain": "company.com",
    "domain_aliases": [
      "company.com"
    ],
    "should_trust_email_verified_connection": "never_set_emails_as_verified"
  },
  "strategy": "waad",
  "name": "connection-name",
  "is_domain_connection": false,
  "show_as_button": false,
  "enabled_clients": [],
  "realms": [
    "connection-name"
  ]
}

Recommended content

No recommended content found...