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

apiOAuth2 checks for refresh_token but doesn't set access_type to offline in createAuthUrl #44

Closed
GoogleCodeExporter opened this issue Dec 16, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Set up apiClient using class in apiOAuth as auth class in config
2. Run authentication with redirect set to authorization method.
3. Upon receiving authorization code the authenticate method will try to make 
the exchange for an access token.
4. Because the access_type is not set, no refresh_token is sent back causing a 
validation error on setAccessToken()

What is the expected output? What do you see instead?
After creating the Auth url (auth/apiOAuth2 #91) for the authorization grant 
and getting back the parameter "code" the authenticate method should request an 
access token. When successful the setAccessToken in apiOAuth2 class should run 
correctly but throws apiAuthException("Invalid token format") instead.

What version of the product are you using? On what operating system?
google-api-php-client 0.47 
PHP 5.3.6
Fedora 2.6.35.14-96.fc14.i686.PAE

Please provide any additional information below.
According to the documents 
(http://code.google.com/p/google-api-php-client/wiki/OAuth2), refresh_token 
only returns when when access_type is set to offline on authorization. But the 
setAccessToken method in apiOAuth2 throws an exception when refresh_token is 
not set (auth/apiOAuth2 #107). 

Original issue reported on code.google.com by ijohn...@eng.compendiumblogware.com on 10 Dec 2011 at 1:40

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

Thank you for reporting this issue. It is now fixed on trunk.

Original comment by chirags@google.com on 12 Dec 2011 at 5:05

  • Changed state: Fixed

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

No branches or pull requests

1 participant