This article explains why users authenticating via Single Sign-On (SSO) on a Salesforce Experience Cloud community built with a custom Aura login component are redirected to the community root page instead of their intended destination page after successful authentication. SSO is an authentication method that allows users to log in once and gain access to multiple connected systems without logging in again for each one.
The root cause is that the Aura framework does not propagate the startURL (the intended destination page URL the user was trying to reach before being redirected to log in) through the SAML authentication flow to the social login component.
When a custom Aura-based login form triggers the SSO flow using the SAML authentication request endpoint for the community, the startURL (the community page path the user intended to reach) is not carried through to the SAML AuthnRequest. As a result, the RelayState parameter — which is used by SAML to carry the intended destination URL back through the authentication handshake — is sent as a forward slash ("/"), representing the site root, instead of the actual community page path.
After the Identity Provider (IdP) authenticates the user and redirects them back to Salesforce, the user lands on the default community root page instead of the page they originally requested.
A customer clicks a link to a specific community page, such as a knowledge article at the community path for a specific topic. Salesforce detects the user is not authenticated and redirects them to the community login page, storing the intended destination as the startURL. The custom Aura login component triggers the SAML SSO flow. Because the Aura social login component does not receive the startURL from the Aura login form, RelayState is set to "/" in the AuthnRequest. The IdP authenticates the user and redirects them back to Salesforce. Salesforce reads the RelayState value of "/" and redirects the user to the community root page instead of the original article page. The user must manually navigate back to the page they intended to visit.
This behavior occurs because the social login component in the Aura framework depends on the login form to supply the startURL. The Aura framework does not pass this value through correctly. The LWC framework received an enhancement to handle this propagation correctly, so migrating the login component to LWC resolves the issue.
This issue is resolved by replacing the custom Aura-based login component with the LWC (Lightning Web Component) login component. The LWC login component correctly handles startURL propagation through all SSO navigation flows, ensuring users are redirected to their intended destination page after successful IdP authentication.
Recommended Fix — Migrate to LWC Login Component
To resolve the RelayState and startURL propagation issue in Experience Cloud SSO with a custom Aura login component, follow these steps:
005387719

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.