Skip to content
Snippets Groups Projects
Commit 4bc983a8 authored by Jaime Perez Crespo's avatar Jaime Perez Crespo
Browse files

Deprecate SimpleSAML_Default::logoutCallback() and move it to...

Deprecate SimpleSAML_Default::logoutCallback() and move it to SimpleSAML_Auth_Source. This also resolves an issue with this callback not being called, since SimpleSAML_Auth_Source::initLogin() was expecting the method to be inside that class.
parent 48081b92
No related branches found
No related tags found
No related merge requests found
...@@ -145,25 +145,11 @@ class SimpleSAML_Auth_Default { ...@@ -145,25 +145,11 @@ class SimpleSAML_Auth_Default {
* Called when the authentication source receives an external logout request. * Called when the authentication source receives an external logout request.
* *
* @param array $state State array for the logout operation. * @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) { public static function logoutCallback($state) {
assert('is_array($state)'); SimpleSAML_Auth_Source::logoutCallback($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);
} }
......
...@@ -350,6 +350,31 @@ abstract class SimpleSAML_Auth_Source ...@@ -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. * Add a logout callback association.
* *
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment