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