Skip to content
Snippets Groups Projects
Commit c75b81bf authored by Tim van Dijen's avatar Tim van Dijen
Browse files

Fixes for modules/multiauth

parent 8276751e
No related branches found
No related tags found
No related merge requests found
...@@ -9,7 +9,6 @@ namespace SimpleSAML\Module\multiauth\Auth\Source; ...@@ -9,7 +9,6 @@ namespace SimpleSAML\Module\multiauth\Auth\Source;
* @author Lorenzo Gil, Yaco Sistemas S.L. * @author Lorenzo Gil, Yaco Sistemas S.L.
* @package SimpleSAMLphp * @package SimpleSAMLphp
*/ */
class MultiAuth extends \SimpleSAML\Auth\Source class MultiAuth extends \SimpleSAML\Auth\Source
{ {
/** /**
...@@ -42,6 +41,7 @@ class MultiAuth extends \SimpleSAML\Auth\Source ...@@ -42,6 +41,7 @@ class MultiAuth extends \SimpleSAML\Auth\Source
*/ */
private $preselect; private $preselect;
/** /**
* Constructor for this authentication source. * Constructor for this authentication source.
* *
...@@ -111,6 +111,7 @@ class MultiAuth extends \SimpleSAML\Auth\Source ...@@ -111,6 +111,7 @@ class MultiAuth extends \SimpleSAML\Auth\Source
} }
} }
/** /**
* Prompt the user with a list of authentication sources. * Prompt the user with a list of authentication sources.
* *
...@@ -122,6 +123,7 @@ class MultiAuth extends \SimpleSAML\Auth\Source ...@@ -122,6 +123,7 @@ class MultiAuth extends \SimpleSAML\Auth\Source
* in the delegateAuthentication method. * in the delegateAuthentication method.
* *
* @param array &$state Information about the current authentication. * @param array &$state Information about the current authentication.
* @return void
*/ */
public function authenticate(&$state) public function authenticate(&$state)
{ {
...@@ -154,6 +156,7 @@ class MultiAuth extends \SimpleSAML\Auth\Source ...@@ -154,6 +156,7 @@ class MultiAuth extends \SimpleSAML\Auth\Source
assert(false); assert(false);
} }
/** /**
* Delegate authentication. * Delegate authentication.
* *
...@@ -164,6 +167,8 @@ class MultiAuth extends \SimpleSAML\Auth\Source ...@@ -164,6 +167,8 @@ class MultiAuth extends \SimpleSAML\Auth\Source
* *
* @param string $authId Selected authentication source * @param string $authId Selected authentication source
* @param array $state Information about the current authentication. * @param array $state Information about the current authentication.
* @return void
* @throws \Exception
*/ */
public static function delegateAuthentication($authId, $state) public static function delegateAuthentication($authId, $state)
{ {
...@@ -172,6 +177,10 @@ class MultiAuth extends \SimpleSAML\Auth\Source ...@@ -172,6 +177,10 @@ class MultiAuth extends \SimpleSAML\Auth\Source
$as = \SimpleSAML\Auth\Source::getById($authId); $as = \SimpleSAML\Auth\Source::getById($authId);
$valid_sources = array_map( $valid_sources = array_map(
/**
* @param array $src
* @return string
*/
function ($src) { function ($src) {
return $src['source']; return $src['source'];
}, },
...@@ -201,6 +210,7 @@ class MultiAuth extends \SimpleSAML\Auth\Source ...@@ -201,6 +210,7 @@ class MultiAuth extends \SimpleSAML\Auth\Source
\SimpleSAML\Auth\Source::completeAuth($state); \SimpleSAML\Auth\Source::completeAuth($state);
} }
/** /**
* Log out from this authentication source. * Log out from this authentication source.
* *
...@@ -208,6 +218,7 @@ class MultiAuth extends \SimpleSAML\Auth\Source ...@@ -208,6 +218,7 @@ class MultiAuth extends \SimpleSAML\Auth\Source
* session and then call the logout method on it. * session and then call the logout method on it.
* *
* @param array &$state Information about the current logout operation. * @param array &$state Information about the current logout operation.
* @return void
*/ */
public function logout(&$state) public function logout(&$state)
{ {
...@@ -225,6 +236,7 @@ class MultiAuth extends \SimpleSAML\Auth\Source ...@@ -225,6 +236,7 @@ class MultiAuth extends \SimpleSAML\Auth\Source
$source->logout($state); $source->logout($state);
} }
/** /**
* Set the previous authentication source. * Set the previous authentication source.
* *
...@@ -232,6 +244,7 @@ class MultiAuth extends \SimpleSAML\Auth\Source ...@@ -232,6 +244,7 @@ class MultiAuth extends \SimpleSAML\Auth\Source
* by storing its name in a cookie. * by storing its name in a cookie.
* *
* @param string $source Name of the authentication source the user selected. * @param string $source Name of the authentication source the user selected.
* @return void
*/ */
public function setPreviousSource($source) public function setPreviousSource($source)
{ {
...@@ -251,11 +264,13 @@ class MultiAuth extends \SimpleSAML\Auth\Source ...@@ -251,11 +264,13 @@ class MultiAuth extends \SimpleSAML\Auth\Source
\SimpleSAML\Utils\HTTP::setCookie($cookieName, $source, $params, false); \SimpleSAML\Utils\HTTP::setCookie($cookieName, $source, $params, false);
} }
/** /**
* Get the previous authentication source. * Get the previous authentication source.
* *
* This method retrieves the authentication source that the user selected * This method retrieves the authentication source that the user selected
* last time or NULL if this is the first time or remembering is disabled. * last time or NULL if this is the first time or remembering is disabled.
* @return string|null
*/ */
public function getPreviousSource() public function getPreviousSource()
{ {
......
...@@ -19,6 +19,7 @@ $state = \SimpleSAML\Auth\State::loadState($authStateId, \SimpleSAML\Module\mult ...@@ -19,6 +19,7 @@ $state = \SimpleSAML\Auth\State::loadState($authStateId, \SimpleSAML\Module\mult
if (array_key_exists("\SimpleSAML\Auth\Source.id", $state)) { if (array_key_exists("\SimpleSAML\Auth\Source.id", $state)) {
$authId = $state["\SimpleSAML\Auth\Source.id"]; $authId = $state["\SimpleSAML\Auth\Source.id"];
/** @var \SimpleSAML\Module\multiauth\Auth\Source\MultiAuth $as */
$as = \SimpleSAML\Auth\Source::getById($authId); $as = \SimpleSAML\Auth\Source::getById($authId);
} else { } else {
$as = null; $as = null;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment