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

Problem in getting the refresh token with the recent version #61

Closed
hudarsono opened this issue Aug 12, 2015 · 3 comments
Closed

Problem in getting the refresh token with the recent version #61

hudarsono opened this issue Aug 12, 2015 · 3 comments

Comments

@hudarsono
Copy link

Hi There,

We noticed that recently we couldn't get a refresh token for our web application using this gem. We have been using this gem continuously for 3 years without issue with getting refresh token.

We have added the param in our code such as ;
api.authorize({ oauth2_callback: oauth2_callback_platform_partners_url,
oauth2_access_type: "offline", # ask to return refresh token
approval_prompt: "force" }) # force to request user consent

It works in 'localhost', but not in other domain than "localhost" such as our production app. We only being returned the access token without refresh token. And no user consent window had pop up on our production app.

Any changes in they way the gem handles OAuth2?

@hudarsono
Copy link
Author

After reading the source code, we found that the parameter has been changed from "approval_prompt" to "oauth2_approval_prompt" somewhere in between version. After making that changes, it started working again.
I think it would be good if any change like this is documented as lib migration note.

@mcloonan
Copy link
Member

What was the last version that this was working on for you? I'm trying to narrow down the specific source of the error.

@mcloonan
Copy link
Member

Ah, I found the issue.

We never supported :approval_prompt. To set this option from our library, the argument was always :oauth2_approval_prompt. So this means that your setting was getting lost.

However, signet's default setting for :approval_prompt used to be "force", but changed in a recent update to signet that we incorporated into our library. So the default setting happened to be the same as what you wanted, but it's not anymore.

I will look into making 'force' the default action by the client library in a future version; however, this isn't actually a bug and now you're setting the correct attribute, so I'm going to close this issue.

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