diff --git a/src/AuthorizationValidators/BearerTokenValidator.php b/src/AuthorizationValidators/BearerTokenValidator.php index 98ff615e3..0442dd48e 100644 --- a/src/AuthorizationValidators/BearerTokenValidator.php +++ b/src/AuthorizationValidators/BearerTokenValidator.php @@ -74,20 +74,13 @@ private function initJwtConfiguration(): void throw new RuntimeException('Public key is empty'); } - $validationConstraints = [ + $this->jwtConfiguration->setValidationConstraints( new LooseValidAt($clock, $this->jwtValidAtDateLeeway), new SignedWith( new Sha256(), InMemory::plainText($publicKeyContents, $this->publicKey->getPassPhrase() ?? '') - ), - ]; - - // TODO: next major release: bump lcobucci/jwt to ^5.5 and remove the following check - if (method_exists($this->jwtConfiguration, 'withValidationConstraints') === true) { - $this->jwtConfiguration = $this->jwtConfiguration->withValidationConstraints(...$validationConstraints); - } else { - $this->jwtConfiguration->setValidationConstraints(...$validationConstraints); - } + ) + ); } /**