Skip to content

How to obtain refresh token when using client credentials? #195

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

Closed
scaleupcto opened this issue Jul 22, 2013 · 9 comments
Closed

How to obtain refresh token when using client credentials? #195

scaleupcto opened this issue Jul 22, 2013 · 9 comments

Comments

@scaleupcto
Copy link

Hi

This is more of a question than an issue.

I can see that a RefreshToken grant type takes a refresh token and issues a new access_token.

However, in the light of this issue I cannot see how to actually obtain a refresh token in the first place when using Client Credentials?

Great library by the way ;)

Thanks,

Chris

@bshaffer
Copy link
Owner

The spec states the ClientCredentials grant type MUST NOT allow for the issuing of refresh tokens. So the answer is, you have to use a different grant type to receive a refresh token with your access token.

@joscarsson
Copy link

This is the second hit when googling this, so to be absolutely correct it should be noted that the client credentials grant type SHOULD NOT issue a refresh token (http://tools.ietf.org/html/rfc6749#section-4.4.3). I think you are confusing it with the implicit grant, in which refresh tokens MUST NOT be issued.

@scaleupcto
Copy link
Author

Ok thanks for the clarification guys...

@Kalyse
Copy link

Kalyse commented Mar 24, 2015

Does anyone know the rationale for this? I actually can't figure out why this would be the case. Seems like an arbitrary decision?..

My first thought was that client_credentials grant doesn't require a username and password so an attacker who compromises your application key would find it easier to stay hidden?

@dashohoxha
Copy link

Maybe because it makes no sense to refresh a token, when you can just as easy get a new one (no user approval required for getting a token when using client credentials).

@oytuntez
Copy link

oytuntez commented Sep 5, 2015

@bshaffer, just to clarify: are we reading SHOULD NOT cases as MUST NOT on the current implementation of the package, just like in this refresh token case?

@bshaffer
Copy link
Owner

bshaffer commented Sep 8, 2015

@oytuntez no, just in this case, and even here it was an accident. We can definitely open Client Credentials up for Refresh Tokens

@bshaffer bshaffer reopened this Sep 8, 2015
@Kalyse
Copy link

Kalyse commented Sep 8, 2015

I posted this many months ago..

http://stackoverflow.com/questions/29233772/why-is-a-refresh-token-not-provided-by-oauth2-servers-responding-to-a-client-cr

@bshaffer
Copy link
Owner

bshaffer commented Sep 8, 2015

Yeah, good points by @Kalyse. Since it's not strictly forbidden, I wouldn't mind if a PR was submitted to add this, but it is not a priority for me.

@bshaffer bshaffer closed this as completed Sep 8, 2015
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

6 participants