diff --git a/lib/SimpleSAML/Auth/Default.php b/lib/SimpleSAML/Auth/Default.php index 4541f02db8840c1aec608923c2a7ec8e139d4003..213ab01c336de7e30b1e675a3471d803615ffa88 100644 --- a/lib/SimpleSAML/Auth/Default.php +++ b/lib/SimpleSAML/Auth/Default.php @@ -145,25 +145,11 @@ class SimpleSAML_Auth_Default { * Called when the authentication source receives an external logout request. * * @param array $state State array for the logout operation. + * + * @deprecated This method will be removed in SSP 2.0. Please use SimpleSAML_Auth_Source::logoutCallback() instead. */ public static function logoutCallback($state) { - assert('is_array($state)'); - assert('array_key_exists("SimpleSAML_Auth_Default.logoutSource", $state)'); - - $source = $state['SimpleSAML_Auth_Default.logoutSource']; - - - $session = SimpleSAML_Session::getSessionFromRequest(); - if (!$session->isValid($source)) { - SimpleSAML_Logger::warning( - 'Received logout from an invalid authentication source '. - var_export($source, TRUE) - ); - - return; - } - - $session->doLogout($source); + SimpleSAML_Auth_Source::logoutCallback($state); } diff --git a/lib/SimpleSAML/Auth/Source.php b/lib/SimpleSAML/Auth/Source.php index 4637f8ba7e7d42a9b6ab04ba0365a96f677a4842..e6dd85624acaa41a59de95cea5ec22e34b3b735c 100644 --- a/lib/SimpleSAML/Auth/Source.php +++ b/lib/SimpleSAML/Auth/Source.php @@ -350,6 +350,31 @@ abstract class SimpleSAML_Auth_Source } + /** + * Called when the authentication source receives an external logout request. + * + * @param array $state State array for the logout operation. + */ + public static function logoutCallback($state) + { + assert('is_array($state)'); + assert('array_key_exists("SimpleSAML_Auth_Default.logoutSource", $state)'); + + $source = $state['SimpleSAML_Auth_Default.logoutSource']; + + $session = SimpleSAML_Session::getSessionFromRequest(); + if (!$session->isValid($source)) { + SimpleSAML_Logger::warning( + 'Received logout from an invalid authentication source '. + var_export($source, true) + ); + + return; + } + $session->doLogout($source); + } + + /** * Add a logout callback association. *