google-api-ruby-client/lib/google/api_client
Jeff Posnick fb67a021e7 Added Google::APIClient::FileStorage, to save OAuth 2 credentials to disk
This is a (potentially rough) bit of code to persist OAuth 2
credentials to disk, similar to
http://google-api-python-client.googlecode.com/hg/docs/epy/oauth2client.
file.Storage-class.html

It can be used in the following manner, which roughly translates to
what the Python client library code looks like.

  file_storage = Google::APIClient::FileStorage.new("#{$0}-oauth2.json")
  if file_storage.authorization.nil?
    client_secrets = Google::APIClient::ClientSecrets.load
    flow = Google::APIClient::InstalledAppFlow.new(
      :client_id => client_secrets.client_id,
      :client_secret => client_secrets.client_secret,
      :scope => [SCOPE1, SCOPE2]
    )
    client.authorization = flow.authorize(file_storage)
  else
    client.authorization = file_storage.authorization
  end
2013-05-29 15:31:44 -04:00
..
auth Added Google::APIClient::FileStorage, to save OAuth 2 credentials to disk 2013-05-29 15:31:44 -04:00
discovery Define custom load/dump for serializing API instances 2013-01-02 16:13:26 -08:00
batch.rb Fix URI in batched request to allow query parameters 2013-02-15 13:13:58 -08:00
client_secrets.rb Remove stray output to STDOUT 2013-01-02 12:55:52 -08:00
discovery.rb Better way to handle automatic parsing using the schemas in the discovery document. 2011-08-04 23:36:36 -04:00
environment.rb Fixed formatting issue with OS version number in Java. 2012-03-14 17:11:19 +01:00
errors.rb Moving BatchError to errors.rb 2012-05-18 10:45:54 +01:00
logging.rb Sprinkle of logging 2013-01-04 16:14:14 -08:00
media.rb Add method for checking if upload can be resumed 2012-10-10 14:28:46 -06:00
railtie.rb Add railtie 2013-01-02 20:07:17 -08:00
reference.rb Move request class to its own file 2012-10-10 14:28:46 -06:00
request.rb Fix duplication of parameters in qeuery string 2013-01-22 22:14:50 -08:00
result.rb Issue 59 - handle 204 responses more gracefully 2012-10-10 14:28:46 -06:00
service_account.rb Refactor key loading to support PEM + fix issue #62 2012-11-02 13:56:53 -07:00
version.rb Minor release 2013-03-25 21:37:52 -07:00