ip2k / google-api-ruby-client

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

Refresh token #38

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I was looking for it in the source, but couldn't find any reference. I think 
getting, and using a refresh token should be part of the lib. If this is 
already possible with any of your dependencies, then it might be a good idea to 
add an example to the docs. Thank you

Original issue reported on code.google.com by dusan.ma...@gmail.com on 23 Feb 2012 at 10:07

GoogleCodeExporter commented 9 years ago
That's because the authorization component is not always OAuth 2. It can 
technically be OAuth 1, OAuth 2, ClientLogin, AuthSub. The authorization 
technique we're using is designed to account for future improvements that may 
be made to any of the mechanisms as well as new mechanisms that may be 
developed. As such, authorization is handled external to the library and is 
swappable. Look at the signet library for the actual source.

However, obtaining a refresh token *is* documented:
http://code.google.com/p/google-api-ruby-client/wiki/OAuth2

The `fetch_access_token!` method is what actually gives you the refresh token. 
That might seem a little confusing I suppose, but refresh tokens are handed to 
you at the same time as you get the access token.

Original comment by bobaman@google.com on 23 Feb 2012 at 12:57

GoogleCodeExporter commented 9 years ago

Original comment by bobaman@google.com on 2 Mar 2012 at 2:33