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

Deprecate SimpleSAML_Default::loginCompleted() and move it to SimpleSAML_Auth_Source.

parent d89759f4
No related branches found
No related tags found
No related merge requests found
...@@ -88,6 +88,7 @@ The following methods and classes have been deprecated. Refer to the code for al ...@@ -88,6 +88,7 @@ The following methods and classes have been deprecated. Refer to the code for al
* `SimpleSAML_Auth_Default` * `SimpleSAML_Auth_Default`
* `SimpleSAML_Auth_Default::extractPersistentAuthState()` * `SimpleSAML_Auth_Default::extractPersistentAuthState()`
* `SimpleSAML_Auth_Default::handleUnsolicitedAuth()` * `SimpleSAML_Auth_Default::handleUnsolicitedAuth()`
* `SimpleSAML_Auth_Default::loginCompleted()`
* `SimpleSAML_Utilities` * `SimpleSAML_Utilities`
* `SimpleSAML_Utilities::addURLParameter()` * `SimpleSAML_Utilities::addURLParameter()`
* `SimpleSAML_Utilities::aesDecrypt()` * `SimpleSAML_Utilities::aesDecrypt()`
......
...@@ -87,9 +87,7 @@ class SimpleSAML_Auth_Default { ...@@ -87,9 +87,7 @@ class SimpleSAML_Auth_Default {
/** /**
* Called when a login operation has finished. * @deprecated This method will be removed in SSP 2.0.
*
* @param array $state The state after the login.
*/ */
public static function loginCompleted($state) { public static function loginCompleted($state) {
assert('is_array($state)'); assert('is_array($state)');
......
...@@ -147,6 +147,38 @@ abstract class SimpleSAML_Auth_Source ...@@ -147,6 +147,38 @@ abstract class SimpleSAML_Auth_Source
} }
/**
* Called when a login operation has finished.
*
* This method never returns.
*
* @param array $state The state after the login has completed.
*/
protected static function loginCompleted($state)
{
assert('is_array($state)');
assert('array_key_exists("SimpleSAML_Auth_Default.Return", $state)');
assert('array_key_exists("SimpleSAML_Auth_Default.id", $state)');
assert('array_key_exists("Attributes", $state)');
assert('!array_key_exists("LogoutState", $state) || is_array($state["LogoutState"])');
$return = $state['SimpleSAML_Auth_Default.Return'];
// save session state
$session = SimpleSAML_Session::getSessionFromRequest();
$authId = $state['SimpleSAML_Auth_Default.id'];
$state = SimpleSAML_Auth_State::extractPersistentAuthState($state);
$session->doLogin($authId, $state);
if (is_string($return)) { // redirect...
\SimpleSAML\Utils\HTTP::redirectTrustedURL($return);
} else {
call_user_func($return, $state);
}
assert('false');
}
/** /**
* Log out from this authentication source. * Log out from this authentication source.
* *
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment