oauth2-server/tests/api/ClientCredentialsInvalidClientIdCept.php

18 lines
509 B
PHP
Raw Normal View History

2015-04-05 22:48:09 +05:30
<?php
$I = new ApiTester($scenario);
$I->wantTo('get an access token using the client credentials grant, invalid client id');
$I->sendPOST(
'client_credentials.php/access_token',
[
'grant_type' => 'client_credentials',
'client_id' => 'myawesomeapp-wrong',
'client_secret' => 'foobar'
]
);
$I->canSeeResponseCodeIs(401);
$I->canSeeResponseIsJson();
$I->seeResponseContainsJson([
'error' => 'invalid_client',
'message' => 'Client authentication failed.'
]);