diff --git a/src/AuthorizationValidators/BearerTokenValidator.php b/src/AuthorizationValidators/BearerTokenValidator.php index f84e80c3a..a28b9e729 100644 --- a/src/AuthorizationValidators/BearerTokenValidator.php +++ b/src/AuthorizationValidators/BearerTokenValidator.php @@ -19,7 +19,6 @@ use Lcobucci\JWT\Exception; use Lcobucci\JWT\Signer\Key\InMemory; use Lcobucci\JWT\Signer\Rsa\Sha256; -use Lcobucci\JWT\Token\Plain; use Lcobucci\JWT\UnencryptedToken; use Lcobucci\JWT\Validation\Constraint\LooseValidAt; use Lcobucci\JWT\Validation\Constraint\SignedWith; @@ -85,9 +84,9 @@ private function initJwtConfiguration(): void } /** - * Configure the request instance. + * Configure the validated authorization request instance. */ - protected function withRequest(ServerRequestInterface $request, Plain $token): ServerRequestInterface + protected function withValidatedRequest(ServerRequestInterface $request, UnencryptedToken $token): ServerRequestInterface { return $request; } @@ -135,7 +134,7 @@ public function validateAuthorization(ServerRequestInterface $request): ServerRe } // Return the request with additional attributes - return $this->withRequest($request + return $this->withValidatedRequest($request ->withAttribute('oauth_access_token_id', $claims->get('jti')) ->withAttribute('oauth_client_id', $claims->get('aud')[0]) ->withAttribute('oauth_user_id', $claims->get('sub')) diff --git a/src/Entities/Traits/AccessTokenTrait.php b/src/Entities/Traits/AccessTokenTrait.php index febd59bf0..6dab9b33e 100644 --- a/src/Entities/Traits/AccessTokenTrait.php +++ b/src/Entities/Traits/AccessTokenTrait.php @@ -58,7 +58,7 @@ public function initJwtConfiguration(): void /** * Configure the JWT builder instance. */ - protected function withBuilder(Builder $builder): Builder + protected function withJwtBuilder(Builder $builder): Builder { return $builder; } @@ -70,7 +70,7 @@ private function convertToJWT(): Token { $this->initJwtConfiguration(); - return $this->withBuilder($this->jwtConfiguration->builder() + return $this->withJwtBuilder($this->jwtConfiguration->builder() ->permittedFor($this->getClient()->getIdentifier()) ->identifiedBy($this->getIdentifier()) ->issuedAt(new DateTimeImmutable())