php - Refresh token validation fails with Codeception test -
i have phpleague/oauth2 server implementation, working fine, ie generating access/refresh tokens, validating etc.
i have following problem. when refresh token grant_type=refresh_token console curl, new access_token, when doing test:
$i->sendpost('access_token', [ 'grant_type' => 'password', 'client_id' => '111', 'client_secret' => '222', 'username' => 'exampleuser', 'password' => 'examplepass', ]); $i->seeresponsecodeis(200); $i->seeresponsecontainsjson(['token_type' => 'bearer']); // receive proper string, checked out $token = $i->grabdatafromresponsebyjsonpath('$.refresh_token')[0]; $i->sendpost('access_token', [ 'grant_type' => 'refresh_token', 'client_id' => 1, 'client_secret' => 'pass2', 'refresh_token' => $token ]); $i->seeresponsecodeis(200); // here receive 403 ...
i repeat, doing manually in terminal works fine. after debugging myself found out refresh token validation fails @ oauth2-server/src/grant/refreshtokengrant.php at:
$refreshtoken = $this->decrypt($encryptedrefreshtoken);
but still can't understand why works manually. did urlencode/urldecode , tons of var dumps, still can't solution.
Comments
Post a Comment