Skip to content
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

refresh_token being granted in Client Credentials Grant #11

Closed
dsquier opened this issue Dec 1, 2012 · 2 comments
Closed

refresh_token being granted in Client Credentials Grant #11

dsquier opened this issue Dec 1, 2012 · 2 comments

Comments

@dsquier
Copy link
Contributor

dsquier commented Dec 1, 2012

In testing OAuth2_Storage_RefreshTokenInterface, a refresh_token is being returned when using the Client Credentials Grant. It should probably be removed from this grant type to better adhere to http://tools.ietf.org/html/rfc6749#section-4.4.3

4.4.3.  Access Token Response

   If the access token request is valid and authorized, the
   authorization server issues an access token as described in
   Section 5.1.  A refresh token SHOULD NOT be included.

Code from an example call:

$storage = new PDO('mysql:dbname=account;host=localhost', 'oauth', 'oauth');
$server = new OAuth2_Server($storage);
$server->addGrantType(new OAuth2_GrantType_ClientCredentials($storage));

$request = OAuth2_Request::createFromGlobals();
$token = $server->grantAccessToken($request)

echo json_encode($token);

With the following response:

{"access_token":"ce7f0d2cce0e9dc0e6f4d6ed24c5def1afdea5c6","expires_in":3600,"token_type":"bearer","scope":null,"refresh_token":"a7db8c2b2bdf4319d6233db394979e89c5809ffe"}
@bshaffer
Copy link
Owner

Thank you for reporting this!

@bshaffer
Copy link
Owner

Fixed by 81ceb46

  • ClientCredentials does not issue refresh token
  • Access Token authorize requests do not issue refresh token in fragment
  • Refresh Token grant requests can be configured to not issue refresh token

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants