Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is exactly RelayState parameter used in SSO (Ex. SAML)?

I am trying to understand SSO using SAML. I have come across the RelayState parameter and am very confused exactly why it comes first in SSO to send encoded URLs? What exactly does it mean?

Please read the following from the Google Developer documentation:

Google generates a SAML authentication request. The SAML request is encoded and embedded into the URL for the partner's SSO service. The RelayState parameter containing the encoded URL of the Google application that the user is trying to reach is also embedded in the SSO URL. This RelayState parameter is meant to be an opaque identifier that is passed back without any modification or inspection

like image 974
Oomph Fortuity Avatar asked Dec 18 '15 07:12

Oomph Fortuity


People also ask

What is the RelayState in SAML?

In Security Assertion Markup Language (SAML) 2.0, RelayState is an optional parameter that identifies a specified destination URL your users will access after signing in with SSO.

How do I get RelayState from SAML response?

First, you can open the SAML2 transaction from your AS ABAP through SAPGUI. Click com Service Provider Settings and scroll-down to RelayState Mapping.

What is RelayState in Okta?

A RelayState is an HTTP parameter that can be included as part of the SAML request and SAML response. In an SP-initiated sign-in flow, the SP can set the RelayState parameter in the SAML request with additional information about the request.

How do you use RelayState in Okta?

To start IdP initiated SAML with Okta you need to use the IdP SSO URL with ? RelayState= appended to the url, not the app embed url. You can find the IdP SSO URL url by clicking "View Setup Instructions" on the Sign On tab for the application in the admin console.


1 Answers

The original meaning of RelayState is that the SP can send some value to the IDP together with the AuthnRequest and then get it back. The SP can put whatever value it wants in the RelayState and the IDP should just echo it back in the response.

This RelayState parameter is meant to be an opaque identifier that is passed back without any modification or inspection

There is also another, de facto standard use for RelayState when using Idp-initiated log on. In that case, there is no incoming request from the SP, so there can be no state to be relayed back. Instead, the RelayState is used by the IDP to signal to the SP what URL the SP should redirect to after successful sign on. In the standard (Bindings 4.1.5) it is stated that RelayState "MAY be the URL of a resource at the service provider."

It looks like Google is using RelayState for the target URL even on SP-initiated sign on, which is perfectly fine. But the IDP should, as the documentation says, just relay it back.

like image 127
Anders Abel Avatar answered Oct 08 '22 04:10

Anders Abel