Skip to content

Commit 42f1e43

Browse files
authored
Merge pull request #1049 from prigaux/main
fix: backchannel logout token may not contain "sub"
2 parents 8a12878 + c6adc7f commit 42f1e43

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

lib/Controller/LoginController.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -724,13 +724,15 @@ public function backChannelLogout(string $providerIdentifier, string $logout_tok
724724
);
725725
}
726726

727-
$sub = $logoutTokenPayload->sub;
728-
if ($oidcSession->getSub() !== $sub) {
729-
return $this->getBackchannelLogoutErrorResponse(
730-
'invalid SUB',
731-
'The sub does not match the one from the login ID token',
732-
['invalid_sub' => $sub]
733-
);
727+
if (isset($logoutTokenPayload->sub)) {
728+
$sub = $logoutTokenPayload->sub;
729+
if ($oidcSession->getSub() !== $sub) {
730+
return $this->getBackchannelLogoutErrorResponse(
731+
'invalid SUB',
732+
'The sub does not match the one from the login ID token',
733+
['invalid_sub' => $sub]
734+
);
735+
}
734736
}
735737
$iss = $logoutTokenPayload->iss;
736738
if ($oidcSession->getIss() !== $iss) {

0 commit comments

Comments
 (0)