Trying to set up a redirect in simplesamlphp to take the user back to the page they were trying to access before being sent to authentication.
I'm using the ReturnTo option:
$as->requireAuth(array("ReturnTo" => $returnURL, 'KeepPost' => FALSE));
With metadata for remote-idp set up like this (stripped for example):
$metadata['sample'] = array(
'name' => 'sample',
'entityid' => 'https://sample.com/saml/module.php/saml/sp/metadata.php/sample',
'metadata-set' => 'saml20-idp-remote',
'SingleSignOnService' =>
array (
0 =>
array (
'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect',
'Location' => 'https://sample:port/idp/startSSO.ping?PartnerSpId=https://sample.com/saml/module.php/saml/sp/metadata.php/sample'
)
),
'keys' => array(...)
);
I need to pass a parameter "TARGET" into the idp startSSO in the above metadata, but haven't been able to find how to translate the "ReturnTo" option to be added onto this SSO url. I've also captured/examined the SAML redirect xml, and the ReturnTo is not in there at all. Anyone know how to do this?