Loading

Multiple Custom Domains Mapped to the Same Experience Cloud Site with Auth Provider

Publiceringsdatum: Jul 9, 2026
Beskrivning

When multiple custom domains are mapped to the same Experience Cloud site and users log in through an Authentication Provider (Auth Provider) — such as Azure Active Directory or Google — they are always redirected to the site's primary domain URL after a successful login, regardless of which custom domain they used to start the login process.

Example: If both 'example.com' and 'example.cn' are mapped to the same Experience Cloud site, and 'example.cn' is alphabetically first in the Custom URLs list, a user who starts login from example.com is redirected to example.cn after completing authentication through the Auth Provider.

This is expected platform behavior and is not a product defect.

Root Cause 

When multiple custom domains are associated with the same Experience Cloud site and no Primary URL is explicitly selected, Salesforce determines the redirect destination using the first HTTPS custom URL in alphabetical order. During the Auth Provider authentication process, Salesforce redirects users to this effective primary URL — even if they initiated login through a different custom domain.

How to identify your primary domain 

The primary domain is the URL displayed for your site in the 'All Sites' section in Salesforce Setup.

Lösning

This behavior is by design. To control which domain users are redirected to after Auth Provider authentication, explicitly set a Primary URL for your Experience Cloud site.

Steps to set a Primary URL:

  1. Navigate to Salesforce Setup and search for All Sites in the Quick Find box.
  2. Locate your Experience Cloud site in the list and click Manage next to it.
  3. In the Custom URLs section, review the list of custom domains mapped to this site.
  4. Identify the domain you want users to be redirected to after login (your preferred primary domain).
  5. Select that domain as the Primary URL for the site.
  6. Verify your Auth Provider callback URL configuration to ensure it includes the primary domain you selected as an allowed redirect URL.
  7. Test by logging in through a non-primary custom domain and confirming users are redirected to your chosen primary domain after authentication.

Note: The External Host — the domain users type into their browser — is not affected. Only the post-authentication redirect destination changes based on the Primary URL setting.

Knowledge-artikelnummer

005387489

 
Laddar
Salesforce Help | Article