Skip to content
Snippets Groups Projects
Commit 9485b0bf authored by Jacob Christiansen's avatar Jacob Christiansen
Browse files

Minor fix to standart discovery to support scoping

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2297 44740490-163a-0410-bde0-09ae8108e29a
parent 3ff9e44f
No related branches found
No related tags found
No related merge requests found
...@@ -482,6 +482,11 @@ class SimpleSAML_XHTML_IdPDisco { ...@@ -482,6 +482,11 @@ class SimpleSAML_XHTML_IdPDisco {
if (sizeof($idpintersection) > 0) { if (sizeof($idpintersection) > 0) {
$idpList = array_intersect_key($idpList, array_fill_keys($idpintersection, NULL)); $idpList = array_intersect_key($idpList, array_fill_keys($idpintersection, NULL));
} }
if(sizeof($idpintersection) == 1) {
$this->log('Choice made [' . $idpintersection[0] . '] (Redirecting the user back. returnIDParam=' . $this->returnIdParam . ')');
SimpleSAML_Utilities::redirect($this->returnURL, array($this->returnIdParam => $idpintersection[0]));
}
/* /*
* Make use of an XHTML template to present the select IdP choice to the user. * Make use of an XHTML template to present the select IdP choice to the user.
...@@ -510,4 +515,4 @@ class SimpleSAML_XHTML_IdPDisco { ...@@ -510,4 +515,4 @@ class SimpleSAML_XHTML_IdPDisco {
} }
} }
?> ?>
\ No newline at end of file
...@@ -212,9 +212,9 @@ class sspmod_saml_Auth_Source_SP extends SimpleSAML_Auth_Source { ...@@ -212,9 +212,9 @@ class sspmod_saml_Auth_Source_SP extends SimpleSAML_Auth_Source {
if (isset($state['saml:IDPList'])) { if (isset($state['saml:IDPList'])) {
$IDPList = $state['saml:IDPList']; $IDPList = $state['saml:IDPList'];
} else { } else {
$IDPList = array(); $IDPList = array();
} }
$ar->setIDPList(array_unique(array_merge($this->metadata->getArray('IDPList', array()), $ar->setIDPList(array_unique(array_merge($this->metadata->getArray('IDPList', array()),
$idpMetadata->getArray('IDPList', array()), $idpMetadata->getArray('IDPList', array()),
(array) $IDPList))); (array) $IDPList)));
...@@ -294,12 +294,18 @@ class sspmod_saml_Auth_Source_SP extends SimpleSAML_Auth_Source { ...@@ -294,12 +294,18 @@ class sspmod_saml_Auth_Source_SP extends SimpleSAML_Auth_Source {
} }
$returnTo = SimpleSAML_Module::getModuleURL('saml/sp/discoresp.php', array('AuthID' => $id)); $returnTo = SimpleSAML_Module::getModuleURL('saml/sp/discoresp.php', array('AuthID' => $id));
SimpleSAML_Utilities::redirect($discoURL, array( $params = array(
'entityID' => $this->entityId, 'entityID' => $this->entityId,
'return' => $returnTo, 'return' => $returnTo,
'returnIDParam' => 'idpentityid') 'returnIDParam' => 'idpentityid'
); );
if(isset($state['saml:IDPList'])) {
$params['IDPList'] = $state['saml:IDPList'];
}
SimpleSAML_Utilities::redirect($discoURL, $params);
} }
...@@ -482,4 +488,4 @@ class sspmod_saml_Auth_Source_SP extends SimpleSAML_Auth_Source { ...@@ -482,4 +488,4 @@ class sspmod_saml_Auth_Source_SP extends SimpleSAML_Auth_Source {
SimpleSAML_Auth_Source::completeAuth($state); SimpleSAML_Auth_Source::completeAuth($state);
} }
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment