In Salesforce Single Sign-On (SSO) configurations that use SAML (Security Assertion Markup Language), RelayState is an optional HTTP parameter that can be included alongside a SAML authentication request. It specifies the exact Salesforce page a user should land on after successfully authenticating through an Identity Provider (IDP) — also referred to as an IdP.
This is particularly useful when you want users to be redirected to a specific Salesforce page — such as a Visualforce page, a record detail page, or a specific app — rather than the default Salesforce home page after login.
RelayState is part of the SAML standard and is supported by Salesforce when Salesforce is configured as the Service Provider (SP).
RelayState is sent as an HTTP query parameter in the IDP-initiated login URL. After a user successfully authenticates with the Identity Provider, Salesforce reads the RelayState value and redirects the user to the specified Salesforce page.
To direct users to a specific Salesforce page after login, append &RelayState= to the end of your IDP-initiated login URL. The value must be a valid Salesforce relative URL (a path within your Salesforce org).
Example:
If your IDP-initiated login URL is: `
To redirect users to a Visualforce page named "test" after login, append the RelayState parameter: `<REDACTED>
000386068

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.