Skip to content

Commit

Permalink
Merge pull request #803 from catalyst/issue-801-backport
Browse files Browse the repository at this point in the history
[#801] fix issue with IdP initiated login after upgrade to v2.0.5 (#802)
  • Loading branch information
jwalits authored Feb 29, 2024
2 parents 3a62967 + 45a0e20 commit 43d803d
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions .extlib/simplesamlphp/modules/saml/src/Auth/Source/SP.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 43d803d

Please sign in to comment.