Validate user_code expiry during the Device Code grant.

Add mock responses related to the Device Code grant.
This commit is contained in:
ErickSkrauch
2024-12-14 18:55:31 +01:00
parent 2cc27d34ad
commit 119a0f8078
8 changed files with 143 additions and 16 deletions

View File

@@ -36,6 +36,19 @@ final class DeviceCodeCest {
]);
}
public function pollExpiredDeviceCode(FunctionalTester $I): void {
$I->sendPOST('/api/oauth2/v1/token', [
'grant_type' => 'urn:ietf:params:oauth:grant-type:device_code',
'client_id' => 'ely',
'device_code' => 'ZFPbWycSxdRpHiYP2wnv3S0KHBgYky8fRDqfhhCqzke7nKuYFfwckZywqU8iUKv3ek4VtiMiMCkiC0YT',
]);
$I->canSeeResponseCodeIs(400);
$I->canSeeResponseContainsJson([
'error' => 'expired_token',
'message' => 'The `device_code` has expired and the device authorization session has concluded.',
]);
}
/**
* @param Example<array{boolean}> $case
*/