public function MiniOrangeAuthnRequest::initiateLogin in SAML SP 2.0 Single Sign On (SSO) - SAML Service Provider 7
The function initiateLogin.
File
- includes/
AuthnRequest.php, line 23 - The AuthnRequest.php file for the miniorange_samlauth module.
Class
- MiniOrangeAuthnRequest
- The MiniOrangeAuthnRequest class.
Code
public function initiateLogin($acs_url, $sso_url, $issuer) {
$nameid_format = variable_get('miniorange_nameid_format', "");
$relay_state = $_SERVER['HTTP_REFERER'];
$saml_request = Utilities::createAuthnRequest($acs_url, $issuer, $sso_url, $nameid_format);
if (strpos($sso_url, '?') > 0) {
$redirect = $sso_url . '&SAMLRequest=' . $saml_request . '&RelayState=' . urlencode($relay_state);
}
else {
$redirect = $sso_url . '?SAMLRequest=' . $saml_request . '&RelayState=' . urlencode($relay_state);
}
header('Location: ' . $redirect);
}