From 45a0e20653c2a1a6c30add5334abedfb927fe2eb Mon Sep 17 00:00:00 2001 From: Jwalit Shah <56375964+jwalits@users.noreply.github.com> Date: Thu, 29 Feb 2024 16:33:27 +1100 Subject: [PATCH] [#801] fix issue with IdP initiated login after upgrade to v2.0.5 (#802) * [#801] fix issue with IdP initiated login after upgrade to v2.0.5 * [#801] restore comment for searching purposes --- .../modules/saml/src/Auth/Source/SP.php | 21 +++---------------- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/.extlib/simplesamlphp/modules/saml/src/Auth/Source/SP.php b/.extlib/simplesamlphp/modules/saml/src/Auth/Source/SP.php index 9f0bcb4b5..9d660346b 100644 --- a/.extlib/simplesamlphp/modules/saml/src/Auth/Source/SP.php +++ b/.extlib/simplesamlphp/modules/saml/src/Auth/Source/SP.php @@ -307,24 +307,9 @@ public function getHostedMetadata(): array public function getIdPMetadata(string $entityId): Configuration { // auth_saml2 modification. - global $saml2auth; - if ($this->idp !== null && $this->idp !== $entityId) { - foreach ($saml2auth->metadataentities as $metadataurl => $idpentities) { - if ($metadataurl == $entityId) { - foreach ($idpentities as $key => $val) { - if ($key == $this->idp) { - $this->idp = null; - } - break 2; - - } - } - } - } - if ($this->idp !== null && $this->idp !== $entityId) { - throw new Error\Exception('Cannot retrieve metadata for IdP ' . - var_export($entityId, true) . ' because it isn\'t a valid IdP for this SP.'); - } + // Set the IdP to null, so it can auto-detect. + // Avoid the case where it uses the default IdP data for IdP initiated login. + $this->idp = null; $metadataHandler = MetaDataStorageHandler::getMetadataHandler();