What is relayState

in ComponentSpace.SAML2.Profiles.SSOBrowser.ServiceProvider.ReceiveSAMLResponseByHTTPPost(
out samlResponseXml,
out relayState)

what is the relayState ?

Thank you.


Relay state is defined by the SAML specification and is optional extra information that may be sent along with a SAML message.
It’s precise use depends on the particular SAML flow.

Relay State - Target URL
For IdP-initiated SSO, the relay state may specify a URL the SP should redirect to once SSO completes.
For example, an IdP may display a portal page with three different links each to a different page on the same SP web site.
When the IdP sends the SAML response, it includes the URL of one of these pages as the relay state.
After completing automatic login, instead of redirecting to a default page, the SP redirects to the page specified by the relay state.

Relay State - Opaque Data
For SP-initiated SSO or SLO, the relay state is opaque data that the sender (IdP or SP) sends to the partner site (SP or IdP) along with the SAML request.
The receiver must return this relay state along with the SAML response.
The sender may use this relay state to maintain state information.
For example, an SP may send relay state along with a SAML authn request to the IdP.
The relay state is opaque to the IdP and is not interpreted in any way by the IdP.
The IdP returns this relay state along with the SAML response to the SP.
The SP uses the relay state to identify state or other information associated with the original authn request.
Our general recommendation is not to use relay state for maintaining session state etc as there are better ways to do this in ASP.NET.
However, it’s available to use if required.