Skip to content

Commit

Permalink
Fix TypeError in verifyJWTClaims (#442)
Browse files Browse the repository at this point in the history
... when ClientID does not match

Co-authored-by: Robert Vogel <[email protected]>
  • Loading branch information
osnard and Robert Vogel authored Sep 17, 2024
1 parent 9af21bd commit 60919af
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/OpenIDConnectClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -1201,8 +1201,10 @@ protected function verifyJWTClaims($claims, string $accessToken = null): bool
$len = ((int)$bit)/16;
$expected_at_hash = $this->urlEncode(substr(hash('sha'.$bit, $accessToken, true), 0, $len));
}
$auds = $claims->aud;
$auds = is_array( $auds ) ? $auds : [ $auds ];
return (($this->validateIssuer($claims->iss))
&& (($claims->aud === $this->clientID) || in_array($this->clientID, $claims->aud, true))
&& (in_array($this->clientID, $auds, true))
&& ($claims->sub === $this->getIdTokenPayload()->sub)
&& (!isset($claims->nonce) || $claims->nonce === $this->getNonce())
&& ( !isset($claims->exp) || ((is_int($claims->exp)) && ($claims->exp >= time() - $this->leeway)))
Expand Down

0 comments on commit 60919af

Please sign in to comment.