diff --git a/src/Grant/AbstractGrant.php b/src/Grant/AbstractGrant.php index 774557996..0b3aeba87 100644 --- a/src/Grant/AbstractGrant.php +++ b/src/Grant/AbstractGrant.php @@ -454,8 +454,10 @@ protected function issueAccessToken( $accessToken->setExpiryDateTime((new DateTimeImmutable())->add($accessTokenTTL)); $accessToken->setPrivateKey($this->privateKey); - foreach ($claims as $claim) { - $accessToken->addClaim($claim); + if (method_exists($accessToken, 'addClaim')) { + foreach ($claims as $claim) { + $accessToken->addClaim($claim); + } } while ($maxGenerationAttempts-- > 0) {