Skip to content
Snippets Groups Projects
Commit 10d49a18 authored by Olav Morken's avatar Olav Morken
Browse files

multiauth: Add multiauth:preselect authentication parameter.

Thanks to Josselin Jacquard for implementing this.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2887 44740490-163a-0410-bde0-09ae8108e29a
parent 608f1ab4
No related branches found
No related tags found
No related merge requests found
...@@ -64,4 +64,11 @@ For example: ...@@ -64,4 +64,11 @@ For example:
htttps://example.com/service/?source=saml htttps://example.com/service/?source=saml
will take you directly to the SAML authentication source, instead will take you directly to the SAML authentication source, instead
of hitting the multiauth select page. of hitting the multiauth select page, but this works only if you
don't have redirections during the authentification process.
You can also use the multiauth:preselect parameter to the login call :
$as = new SimpleSAML_Auth_Simple('my-multiauth-authsource');
$as->login(array(
'multiauth:preselect' => 'default-sp',
));
...@@ -22,6 +22,9 @@ $state = SimpleSAML_Auth_State::loadState($authStateId, sspmod_multiauth_Auth_So ...@@ -22,6 +22,9 @@ $state = SimpleSAML_Auth_State::loadState($authStateId, sspmod_multiauth_Auth_So
if (array_key_exists('source', $_REQUEST)) { if (array_key_exists('source', $_REQUEST)) {
$source = $_REQUEST['source']; $source = $_REQUEST['source'];
sspmod_multiauth_Auth_Source_MultiAuth::delegateAuthentication($source, $state); sspmod_multiauth_Auth_Source_MultiAuth::delegateAuthentication($source, $state);
} elseif (array_key_exists('multiauth:preselect', $state)) {
$source = $state['multiauth:preselect'];
sspmod_multiauth_Auth_Source_MultiAuth::delegateAuthentication($source, $state);
} }
$globalConfig = SimpleSAML_Configuration::getInstance(); $globalConfig = SimpleSAML_Configuration::getInstance();
......
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