NikosTsolakos / google-api-php-client

Automatically exported from code.google.com/p/google-api-php-client
Apache License 2.0
0 stars 0 forks source link

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

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
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 commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
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