-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to get the new acces token with refresh token #45
Comments
Your client ID is empty... You must supply a client ID and your storage engine in turn must support that client ID / client secret combination. |
Even when I fill the client IDn I've got the same error: but when I edit the grant_types table in the db to refresh_token that's work . |
Does your server know about the client id / secret you're using? |
yea, I insert clientid/clientsecret in the db |
the error |
Great ! How can I found this information ? i didnt see any informations about this issue. |
Hello all,
I am trying to get a new acces token by adding the refresh token on the body request:
{
"grant_type":"refresh_token",
"client_id":"",
"client_secret":"",
"refresh_token": "e1f28c7f460dfa076d675937a574c0c856f56298"
}
But I got this error:
{
"error": "unauthorized_client",
"error_description": "The grant type is unauthorized for this client_id"
}
Here my PHP code:
require_once('src/OAuth2/Autoloader.php');
OAuth2\Autoloader::register();
// $dsn is the Data Source Name for your database, for exmaple "mysql:dbname=my_oauth2_db;host=localhost"
$storageD = new OAuth2\Storage\Pdo(array('dsn' => $dsn, 'username' => $username, 'password' => $password));
// create a storage object
$server = new OAuth2\Server($storageD);
$grantTypeR = new OAuth2\GrantType\RefreshToken($storageD);
$grantType = new OAuth2\GrantType\UserCredentials($storageD);
$server->addGrantType($grantType);
$server->addGrantType($grantTypeR);
But when I edit on the db the grant_type to refresh_token that's work !
The text was updated successfully, but these errors were encountered: