oauth2-php icon indicating copy to clipboard operation
oauth2-php copied to clipboard

Bug with refresh token ?

Open shaansharma1980 opened this issue 10 years ago • 1 comments

In the function grantAccessTokenRefreshToken in OAuth2.php, it does a fetch for the current token object, $token = $this->storage->getRefreshToken($input["refresh_token"]);

if ($token === null || $client->getPublicId() !== $token->getClientId()) { .... } In the above condition, $token->getClientId() leads to null as the client is not set on the token object.

I'm not sure if this is a bug or not, I'm a new user so just trying to understand the library and was runnin throught the refresh bit to get it working, I had to put in $token->setClient($client); before the condition is checked above to get it working -> but not happy with putting it in this way.

Could you check and let me know if you think its something specific to my implementation, i'm using sylius standard at the moment with the current build.

shaansharma1980 avatar Feb 14 '15 17:02 shaansharma1980

Hi @CitrusTech,

If your client is empty on the RefreshToken object it's probably a mapping issue... Are you using the FOSOAuthServerBundle or the standalone lib? You should browse your database to be sure that the Client relation is set on the AccessToken and RefreshToken tables.

jeremyb avatar Mar 06 '15 11:03 jeremyb