Skip to content

Commit 0b007b6

Browse files
committed
changes for 3.1
1 parent 5ff21c8 commit 0b007b6

3 files changed

Lines changed: 24 additions & 1 deletion

File tree

src/Saml2/Auth.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ public function processSLO($keepLocalSession = false, $requestId = null, $retrie
322322
$parameters['Signature'] = $signature;
323323
}
324324

325-
return $this->redirectTo($this->getSLOurl(), $parameters, $stay);
325+
return $this->redirectTo($this->getSLOResponseUrl(), $parameters, $stay);
326326
}
327327
} else {
328328
$this->_errors[] = 'invalid_binding';
@@ -632,6 +632,20 @@ public function getSLOurl()
632632
return $url;
633633
}
634634

635+
/**
636+
* Gets the SLO response url.
637+
*
638+
* @return string|null The response url of the Single Logout Service
639+
*/
640+
public function getSLOResponseUrl()
641+
{
642+
$idpData = $this->_settings->getIdPData();
643+
if (isset($idpData['singleLogoutService']) && isset($idpData['singleLogoutService']['responseUrl'])) {
644+
return $idpData['singleLogoutService']['responseUrl'];
645+
}
646+
return $this->getSLOurl();
647+
}
648+
635649
/**
636650
* Gets the ID of the last AuthNRequest or LogoutRequest generated by the Service Provider.
637651
*

src/Saml2/Settings.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,14 @@ public function checkIdPSettings(array $settings)
520520
$errors[] = 'idp_slo_url_invalid';
521521
}
522522

523+
if (isset($idp['singleLogoutService'])
524+
&& isset($idp['singleLogoutService']['responseUrl'])
525+
&& !empty($idp['singleLogoutService']['responseUrl'])
526+
&& !filter_var($idp['singleLogoutService']['responseUrl'], FILTER_VALIDATE_URL)
527+
) {
528+
$errors[] = 'idp_slo_response_url_invalid';
529+
}
530+
523531
if (isset($settings['security'])) {
524532
$security = $settings['security'];
525533

tests/settings/settings1.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
),
2020
'singleLogoutService' => array(
2121
'url' => 'http://idp.example.com/SingleLogoutService.php',
22+
'responseUrl' => 'http://idp.example.com/SingleLogoutServiceResponse.php',
2223
),
2324
'x509cert' => 'MIICgTCCAeoCCQCbOlrWDdX7FTANBgkqhkiG9w0BAQUFADCBhDELMAkGA1UEBhMCTk8xGDAWBgNVBAgTD0FuZHJlYXMgU29sYmVyZzEMMAoGA1UEBxMDRm9vMRAwDgYDVQQKEwdVTklORVRUMRgwFgYDVQQDEw9mZWlkZS5lcmxhbmcubm8xITAfBgkqhkiG9w0BCQEWEmFuZHJlYXNAdW5pbmV0dC5ubzAeFw0wNzA2MTUxMjAxMzVaFw0wNzA4MTQxMjAxMzVaMIGEMQswCQYDVQQGEwJOTzEYMBYGA1UECBMPQW5kcmVhcyBTb2xiZXJnMQwwCgYDVQQHEwNGb28xEDAOBgNVBAoTB1VOSU5FVFQxGDAWBgNVBAMTD2ZlaWRlLmVybGFuZy5ubzEhMB8GCSqGSIb3DQEJARYSYW5kcmVhc0B1bmluZXR0Lm5vMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDivbhR7P516x/S3BqKxupQe0LONoliupiBOesCO3SHbDrl3+q9IbfnfmE04rNuMcPsIxB161TdDpIesLCn7c8aPHISKOtPlAeTZSnb8QAu7aRjZq3+PbrP5uW3TcfCGPtKTytHOge/OlJbo078dVhXQ14d1EDwXJW1rRXuUt4C8QIDAQABMA0GCSqGSIb3DQEBBQUAA4GBACDVfp86HObqY+e8BUoWQ9+VMQx1ASDohBjwOsg2WykUqRXF+dLfcUH9dWR63CtZIKFDbStNomPnQz7nbK+onygwBspVEbnHuUihZq3ZUdmumQqCw4Uvs/1Uvq3orOo/WJVhTyvLgFVK2QarQ4/67OZfHd7R+POBXhophSMv1ZOo',
2425
),

0 commit comments

Comments
 (0)