Skip to content

Commit 844e851

Browse files
authored
Update getLogoutURL to accept nullable relayState parameter to fix iframe logout scenarios where no relayState is available (#37)
1 parent c1b753d commit 844e851

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/IdP/ADFS.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -668,15 +668,19 @@ public static function receiveLogoutMessage(IdP $idp): void
668668
*
669669
* @param \SimpleSAML\IdP $idp
670670
* @param array<mixed> $association
671-
* @param string $relayState
671+
* @param string|null $relayState
672672
* @return string
673673
*/
674-
public static function getLogoutURL(IdP $idp, array $association, string $relayState): string
674+
public static function getLogoutURL(IdP $idp, array $association, ?string $relayState = null): string
675675
{
676676
$metadata = MetaDataStorageHandler::getMetadataHandler();
677677
$spMetadata = $metadata->getMetaDataConfig($association['adfs:entityID'], 'adfs-sp-remote');
678+
$params = ['assocId' => urlencode($association['id'])];
679+
if ($relayState !== null) {
680+
$params['relayState'] = urlencode($relayState);
681+
}
678682
$returnTo = Module::getModuleURL(
679-
'adfs/idp/prp.php?assocId=' . urlencode($association["id"]) . '&relayState=' . urlencode($relayState),
683+
'adfs/idp/prp.php', $params
680684
);
681685
return $spMetadata->getValue('prp') . '?wa=wsignoutcleanup1.0&wreply=' . urlencode($returnTo);
682686
}

0 commit comments

Comments
 (0)