How can I implement a relay state that defines a specific locale?

Answer

A relay state is basically just a token to select a redirect target after successful authentication (i.e., after the SAML/consume URL is called).

The name of the relay state is arbitrary and can be anything (it should contain only letters, no whitespaces).

If a relay state is not found or none is declared, it uses the default target which is:

/app/modules/?triggerLogin=true&username=USERNAME&partition=PARTITION

 

So you could set up states like:

localeDE : /app/?locale=de&uiLanguage=de

localeEN: /app/?locale=en-us&uiLanguage=en-us

 

Now you need to add the state name into the login process. Here it depends where it starts.

If you start off the sign-on URL, you just append it to the URL:

..../saml/signon?RelayState=localeDE

If it is IdP triggered, the IdP configuration needs to have that “RelayState=localeDE” in its consume URL.

Found an issue in documentation? Write to us.