Managing external identities to enable secure access for partners, customers, and other non-employees
Yes, this is supported. A custom URL domain such as https://auth.contoso.com can front Microsoft Entra External ID endpoints like https://{tenant-name}.ciamlogin.com/{tenant-id}/oauth2/v2.0/authorize using Azure Front Door, and Cloudflare can sit in front as a WAF.
Below is a step‑by‑step outline based on the documented flow and your components (External ID + Azure Front Door + Cloudflare).
- Prepare and verify the custom domain in the external tenant
- Sign in to the Microsoft Entra admin center as a Domain Name Administrator.
- Switch to the external tenant.
- Go to Identity > Settings > Domain names > Custom domain names.
- Add the custom domain name you want to use, for example
auth.contoso.com. - At the DNS provider, create the required TXT (or MX) record to verify ownership. The TXT record must be on the exact hostname (for example,
authforauth.contoso.com), not on the root (@). - After verification completes, delete the TXT record as recommended.
- If multiple subdomains will be used (for example,
login.contoso.comandaccount.contoso.com), verify each subdomain individually. - Associate the verified domain with a custom URL domain
- In the same external tenant, navigate to Entra ID > Domain names > Custom URL domains.
- Select Add custom url domain.
- Choose the verified custom domain (for example,
auth.contoso.com). - Select Add.
This associates the DNS name with External ID so it can be used as an authentication endpoint host.
- Configure Azure Front Door for the custom URL domain
- In Azure Front Door, add a custom domain with the hostname you want to expose, for example
auth.contoso.com. - For DNS management, choose All other DNS services.
- Enter the custom domain (
auth.contoso.com) and add it. - Under Validation state, open the Pending pane and copy the TXT record details.
- In the DNS provider for
contoso.com, create the TXT record:- Name: the subdomain part of
_dnsauth.contoso.com(for example,_dnsauth). - Type:
TXT. - Value: the value provided by Front Door.
- Name: the subdomain part of
- Wait until the Validation state changes from Pending to Approved in Front Door.
- Under Endpoint association, select Unassociated, choose the Front Door endpoint that fronts External ID, and select the appropriate route (for example,
default-route). - In Front Door manager, select the endpoint, open
default-route, check Enabled route, and Update.
At this point, DNS for the custom hostname must have a CNAME pointing to the Front Door default front-end host (for example, contoso-frontend.azurefd.net), as described in the custom URL domain network flow.
- Place Cloudflare WAF in front (optional but supported)
If Cloudflare is used as WAF in front of Azure Front Door:
- Ensure the custom domain (
auth.contoso.com) is managed in Cloudflare. - In Cloudflare DNS, configure a CNAME for
auth.contoso.comthat points to the Azure Front Door front-end host. - Set Proxy status to Proxied so Cloudflare WAF is active.
- Enable Cloudflare security controls (DDoS, Bot protection, etc.) as needed.
Note: When a third‑party DNS/WAF like Cloudflare fronts Azure Front Door, Azure Front Door–managed certificates are not auto‑renewed if the CNAME no longer points directly to the Front Door endpoint domain. In that case, follow the documented certificate renewal guidance for Azure Front Door.
- Update application endpoints to use the custom URL domain
Once the custom URL domain is configured and routed through Front Door (and optionally Cloudflare), update client applications to use the new host instead of *.ciamlogin.com.
For OpenID Connect/OAuth2 endpoints, the patterns become:
- OpenID configuration:
-
https://auth.contoso.com/{tenant-name}/v2.0/.well-known/openid-configuration
-
- Authorization endpoint:
-
https://auth.contoso.com/{tenant-name}/oauth2/v2.0/authorize
-
- Token endpoint:
-
https://auth.contoso.com/{tenant-name}/oauth2/v2.0/token
-
{tenant-name} can be replaced with the tenant ID GUID to remove onmicrosoft.com from URLs, for example:
-
https://auth.contoso.com/{tenant-id-guid}/oauth2/v2.0/authorize
If using SAML, the SP metadata URL would look like:
-
https://auth.contoso.com/{tenant-name}/Samlp/metadata
Also update any OAuth redirect URIs registered in the identity provider to use the custom domain, for example:
-
https://auth.contoso.com/{tenant-id-guid}/oauth2/authresp
- How to test the configuration
- DNS resolution test
- From a client machine, resolve
auth.contoso.comand confirm it resolves successfully. - Verify that the CNAME chain ultimately points to the Azure Front Door front-end host.
- From a client machine, resolve
- OpenID configuration test
- In a browser or HTTP client, request:
-
https://auth.contoso.com/{tenant-name}/v2.0/.well-known/openid-configuration
-
- Confirm a valid JSON OpenID configuration document is returned and that the
authorization_endpointandtoken_endpointvalues useauth.contoso.com.
- In a browser or HTTP client, request:
- Authorization redirect test
- Configure a test application to use the authority
https://auth.contoso.com/{tenant-name}/v2.0(or with tenant ID). - Initiate a sign‑in from the application.
- Confirm the browser is redirected to
https://auth.contoso.com/.../oauth2/v2.0/authorizeand the External ID sign‑in page loads correctly.
- Configure a test application to use the authority
- Token acquisition test
- Complete the sign‑in and ensure the app successfully receives tokens.
- Inspect the OpenID configuration and token endpoints to confirm they match the custom domain.
- WAF/Front Door path test
- In Cloudflare and Azure Front Door logs, confirm that requests to
auth.contoso.comtraverse Cloudflare WAF, then Azure Front Door, and finally reach the External ID endpoints.
- In Cloudflare and Azure Front Door logs, confirm that requests to
This sequence uses the supported pattern: custom URL domain in External ID, Azure Front Door as reverse proxy, and optional Cloudflare WAF in front, with applications updated to call the custom domain instead of *.ciamlogin.com.
References: