From e396bc60b7ef4c455a06727b9bcb0cf2230601ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20J=2E=20Garc=C3=ADa=20Lagar?= Date: Mon, 22 Apr 2024 10:24:02 +0200 Subject: [PATCH] Check for error `invalid_grant` instead of `invalid_request` * See https://github.com/thephpleague/oauth2-server/pull/1042 * See https://github.com/thephpleague/oauth2-server/pull/1082 --- tests/Integration/AuthorizationServerTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/Integration/AuthorizationServerTest.php b/tests/Integration/AuthorizationServerTest.php index 61aec75..1b148b2 100644 --- a/tests/Integration/AuthorizationServerTest.php +++ b/tests/Integration/AuthorizationServerTest.php @@ -387,7 +387,7 @@ public function testDifferentClientRefreshGrant(): void $response = $this->handleTokenRequest($request); // Response assertions. - $this->assertSame('invalid_request', $response['error']); + $this->assertSame('invalid_grant', $response['error']); $this->assertSame('The refresh token is invalid.', $response['error_description']); $this->assertSame('Token is not linked to client', $response['hint']); } @@ -422,7 +422,7 @@ public function testExpiredRefreshGrant(): void $response = $this->handleTokenRequest($request); // Response assertions. - $this->assertSame('invalid_request', $response['error']); + $this->assertSame('invalid_grant', $response['error']); $this->assertSame('The refresh token is invalid.', $response['error_description']); $this->assertSame('Token has expired', $response['hint']); } @@ -439,7 +439,7 @@ public function testRevokedRefreshGrant(): void $response = $this->handleTokenRequest($request); // Response assertions. - $this->assertSame('invalid_request', $response['error']); + $this->assertSame('invalid_grant', $response['error']); $this->assertSame('The refresh token is invalid.', $response['error_description']); $this->assertSame('Token has been revoked', $response['hint']); } @@ -468,7 +468,7 @@ public function testInvalidPayloadRefreshGrant(): void $response = $this->handleTokenRequest($request); // Response assertions. - $this->assertSame('invalid_request', $response['error']); + $this->assertSame('invalid_grant', $response['error']); $this->assertSame('The refresh token is invalid.', $response['error_description']); $this->assertSame('Cannot decrypt the refresh token', $response['hint']); }