When multiple custom domains are mapped to the same Experience Cloud site, users who log in through an Authentication Provider (Auth Provider) will always be redirected to the site's primary domain URL after a successful authentication — regardless of which custom domain they used to initiate the login.
Example: If both example.com and example.cn are mapped to the same Experience Cloud site, and example.cn is set as the primary domain, a user who starts login from example.com will be redirected to example.cn after authenticating.
Note: The primary domain is the URL displayed for the site in the All Sites section in Setup.
This is expected behavior and not a product defect.
Root Cause
This is expected platform behavior.
When multiple custom domains are associated with the same Experience Cloud site, Salesforce determines the effective URL based on the site's custom URL configuration. If a Primary URL is not explicitly selected, Salesforce uses the first HTTPS custom URL in alphabetical order.
During the authentication process, users can be redirected to this effective or primary URL, even if they initially accessed the site through a different custom domain.
005387489

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.