Connect to Azure Active Directory Using an OpenID Connect Enterprise Connection in Auth0
Last Updated:
Overview
Administrators configure an OpenID Connect (OIDC) Enterprise connection to Azure Active Directory (AD) in Auth0 as an alternative to the dedicated Azure AD connection type. Using a generic OIDC Enterprise connection simplifies configuration by removing the client secret requirement, enables the use of Azure AD National Cloud instances, and accepts any custom claim included in the ID Token for flexible profile mapping. For more information, refer to Microsoft Entra authentication & national clouds.
Applies To
- Auth0
- Azure Active Directory (AD)
- Enterprise Connections
- OpenID Connect (OIDC)
Solution
How is the application registration configured in Azure Active Directory?
The connection uses the Implicit grant by default, requesting an ID Token with response_mode=form_post. Inspect the token provided by Azure AD by using the browser's developer tools to find the POST to https://<auth0_domain>/login/callback. Decode the token using a tool such as JSON Web Tokens.
Create a new application registration in Azure AD for single-tenant applications, configure the redirect URI, and generate a client secret.
- In Azure AD, create a new application registration.
- For the Redirect URI, select Web as the type and enter
https://<tenant_domain>/login/callback.
NOTE: If using a custom domain, add a second Redirect URI later, after creating the application. - Select Register.
- From the confirmation page, copy the Application (client) ID for later use.
- Select Endpoints and copy the OpenID Connect metadata document URL.
- Navigate to the Authentication section.
- Under Implicit grant and hybrid flows, select the ID tokens checkbox.
- If using a custom domain with Auth0, add a second Redirect URI in the
https://<CustomDomainName>/login/callbackformat. - Select Save.
- Navigate to the Token configuration section.
- Select Add optional claim.
- Select ID.
- Select email, family_name, and given_name, along with any other required claims, and select Add.
- When prompted, accept the request for Microsoft Graph permissions.
- Optionally, select Add groups claim to include group information in the ID Token.
- Navigate to the Certificates & secrets section.
- Select New client secret.
- Copy the Client Secret Value, not the Secret ID.
The OpenID Connect Enterprise connection requires configuration in Auth0.
Create the OpenID Connect connection in the Auth0 Dashboard, input the Azure AD credentials, and enable the connection for the desired applications.
- In the Auth0 Dashboard, navigate to Authentication > Enterprise.
- Select OpenID Connect and choose Create Connection.
- Enter a Connection name.
- In the Issuer URL field, paste the OpenID Connect metadata document URL copied from Azure AD.
- In the Client ID field, paste the Application (client) ID copied from Azure AD.
- Select Create.
- Select the Applications tab for the new connection and enable the connection for at least one application.
- Return to the list of OIDC Enterprise connections, select the three dots to the right of the new connection, and choose Try to test the connection. Auth0 stores all claims included in the ID Token from Azure AD in the user profile.