Skip to content

Commit 43d803d

Browse files
authored
Merge pull request #803 from catalyst/issue-801-backport
[#801] fix issue with IdP initiated login after upgrade to v2.0.5 (#802)
2 parents 3a62967 + 45a0e20 commit 43d803d

File tree

1 file changed

+3
-18
lines changed
  • .extlib/simplesamlphp/modules/saml/src/Auth/Source

1 file changed

+3
-18
lines changed

.extlib/simplesamlphp/modules/saml/src/Auth/Source/SP.php

+3-18
Original file line numberDiff line numberDiff line change
@@ -307,24 +307,9 @@ public function getHostedMetadata(): array
307307
public function getIdPMetadata(string $entityId): Configuration
308308
{
309309
// auth_saml2 modification.
310-
global $saml2auth;
311-
if ($this->idp !== null && $this->idp !== $entityId) {
312-
foreach ($saml2auth->metadataentities as $metadataurl => $idpentities) {
313-
if ($metadataurl == $entityId) {
314-
foreach ($idpentities as $key => $val) {
315-
if ($key == $this->idp) {
316-
$this->idp = null;
317-
}
318-
break 2;
319-
320-
}
321-
}
322-
}
323-
}
324-
if ($this->idp !== null && $this->idp !== $entityId) {
325-
throw new Error\Exception('Cannot retrieve metadata for IdP ' .
326-
var_export($entityId, true) . ' because it isn\'t a valid IdP for this SP.');
327-
}
310+
// Set the IdP to null, so it can auto-detect.
311+
// Avoid the case where it uses the default IdP data for IdP initiated login.
312+
$this->idp = null;
328313

329314
$metadataHandler = MetaDataStorageHandler::getMetadataHandler();
330315

0 commit comments

Comments
 (0)