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

missing oauth2:authorize_password/3 with refresh token #20

Closed
IvanMartinez opened this issue Apr 29, 2013 · 7 comments
Closed

missing oauth2:authorize_password/3 with refresh token #20

IvanMartinez opened this issue Apr 29, 2013 · 7 comments

Comments

@IvanMartinez
Copy link
Contributor

The protocol specification allows to issue a refresh token in the response to a Resource Owner Password Credential Grant:
http://tools.ietf.org/html/rfc6749#section-4.3.3
However the current implementation of oauth2:authorize_password/3 uses issue_token/4, so a refresh token can't be issued. It should be possible to use issue_token_and_refresh/4 when desired.

@bipthelin
Copy link

Agree, this should be in there.

@IvanMartinez
Copy link
Contributor Author

Similar case in oauth2:authorize_code_grant/4, it always issues a refresh token when it is optional in the specification. I see four possible solutions:

  • Making two versions of authorize_password and authorize_code_grant. I don't like it because they would be redundant, only different in wether they use issue_token or issue_token_and_refresh.
  • Add an extra flag parameter to these functions, to tell them wether they should issue a refresh token or not. This is what I'm currently using but I don't really like it, I don't think it's "elegant".
  • Pass issue_token or issue_token_refresh as an argument to authorize_password and authorize_code_grant. I think it's a too fancy and complex solution for a small problem, I don't see the point of so much flexibility if there are just two posibilities.
  • Take issue_token and issue_token_and_refresh out of authorize_password and authorize_code_grant, so developers authorize the grant and then explicitly call the function to issue the token. We would have to change every other oauth2 function to be consistent with this new way. This is my favourite, IMHO it makes perfect sense to separate the request verification from the issuing of tokens and codes.

What do you think?.

@bipthelin
Copy link

I agree that suggestion 4 is probably the way to go.

@IvanMartinez
Copy link
Contributor Author

Good, I will work it out and open and PR.

@bipthelin
Copy link

Awsome, great work Ivan!

@IvanMartinez
Copy link
Contributor Author

See PR #25

@bipthelin
Copy link

Merged

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