RelayState is sometimes not transferred by SAML IdP
First time a user is redirected from a SP to an IdP, he sends some relay state in a form input called "RelayState", conforming to SAML 2. If the user is already authenticated to the IdP, the relay state is properly resent by the IdP to the SP, in a form input called "RelayState". But if the user has to authenticate to the IdP, the relay state is resent to the IdP in a form input called "lmhidden_RelayState", and then the IdP doesn't transfer it to the SP.