Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions Classes/Authentication/OpenIdConnectProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,16 @@ private function audienceMatches(string $expectedAudience, IdentityToken $identi
$this->logger->warning(sprintf('OpenID Connect: The identity token (%s) contain no "aud" value', $identityToken->values['sub'] ?? '?'), LogEnvironment::fromMethodName(__METHOD__));
return false;
}
if ($expectedAudience !== $identityToken->values['aud']) {
$this->logger->warning(sprintf('OpenID Connect: The identity token (%s) was intended for audience "%s" but this authentication provider is configured as audience "%s"', $identityToken->values['sub'], $identityToken->values['aud'], $expectedAudience), LogEnvironment::fromMethodName(__METHOD__));
return false;
if (is_array($identityToken->values['aud'])) {
if (!in_array($expectedAudience, $identityToken->values['aud'])) {
$this->logger->warning(sprintf('OpenID Connect: The identity token (%s) was intended for audience "%s" but this authentication provider is configured as audience "%s"', $identityToken->values['sub'], json_encode($identityToken->values['aud']), $expectedAudience), LogEnvironment::fromMethodName(__METHOD__));
return false;
}
} else {
if ($expectedAudience !== $identityToken->values['aud']) {
$this->logger->warning(sprintf('OpenID Connect: The identity token (%s) was intended for audience "%s" but this authentication provider is configured as audience "%s"', $identityToken->values['sub'], $identityToken->values['aud'], $expectedAudience), LogEnvironment::fromMethodName(__METHOD__));
return false;
}
}
return true;
}
Expand Down