Commit Graph

23 Commits

Author SHA1 Message Date
Abdelkader Boudih e313235b55 Replace deprecated method that cause ruby warnings File.exit? 2014-10-08 12:02:36 +00:00
Ben Barnard c428db0f3d Shutdown WEBrick server used in installed app flow
Starting and stopping WEBrick only controls whether the event loop is
running, it does not start and stop listening on TCP sockets.
Our WEBrick server is starting to listen when it is initialised,
so we should ensure that we shut it down when we are done with it.

Note that shutdown is idempotent.
2013-11-20 00:28:21 +01:00
Johan Euphrosine f5238bbf12 auth: perserve original option param 2013-08-15 14:19:37 -07:00
Johan Euphrosine 9d7735f031 auth: add compute service account 2013-08-14 16:29:16 -07:00
Steven Bazyl 189473cc9e Remove example of deprecated use 2013-06-20 10:34:16 -07:00
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
Oxana Goutnik 7d204ac507 fix for #22 impersonation 2013-01-12 10:29:47 -05:00
Steven Bazyl 8ce4d052fe Add oauth helper for installed apps, update CLI 2013-01-04 16:14:59 -08:00
Steven Bazyl be3b436f58 Fix JWT example in docs 2013-01-02 16:12:47 -08:00
Steven Bazyl a631c4003a Read keyfile in binary mode 2013-01-02 12:59:43 -08:00
Steven Bazyl 71fbe4a825 Use JWT support in signet, ignore broken PKCS12 tests on jruby 2013-01-02 11:50:45 -08:00
Steven Bazyl 1c849c7e7a Refactor key loading to support PEM + fix issue #62 2012-11-02 13:56:53 -07:00
Steven Bazyl 01fc90b3fc Fix sample for JWTAsserter (missing .new) 2012-11-02 12:50:06 -07:00
Steven Bazyl 3d157007f6 Auto-refresh OAuth 2 tokens & retry request on 401 response 2012-10-30 13:18:12 -07:00
Steven Bazyl 5fea10a1d7 Re-org service account support 2012-10-10 14:28:46 -06:00
bobaman@google.com 9d68bf115c Removing transport and OAuth code that is no longer needed.
git-svn-id: https://google-api-ruby-client.googlecode.com/svn/trunk@28 c1d61fac-ed7f-fcc1-18f7-ff78120a04ef
2010-09-13 21:54:18 +00:00
bobaman@google.com e6ba0f6860 Updating code to consistent coding style.
git-svn-id: https://google-api-ruby-client.googlecode.com/svn/trunk@15 c1d61fac-ed7f-fcc1-18f7-ff78120a04ef
2010-08-17 01:21:17 +00:00
bobaman@google.com 63783453e6 Added brief documentation to the handler classes.
git-svn-id: https://google-api-ruby-client.googlecode.com/svn/trunk@12 c1d61fac-ed7f-fcc1-18f7-ff78120a04ef
2010-08-14 01:28:57 +00:00
bobaman@google.com 25786356d3 Added code to determine the location of the discovery document.
git-svn-id: https://google-api-ruby-client.googlecode.com/svn/trunk@11 c1d61fac-ed7f-fcc1-18f7-ff78120a04ef
2010-08-14 01:26:01 +00:00
bobaman@google.com a6d7aa570e Updated the configuration handling code.
git-svn-id: https://google-api-ruby-client.googlecode.com/svn/trunk@10 c1d61fac-ed7f-fcc1-18f7-ff78120a04ef
2010-08-14 01:16:35 +00:00
bobaman@google.com 0d45cbe27b Updated OAuth1 configuration code. Added docs.
git-svn-id: https://google-api-ruby-client.googlecode.com/svn/trunk@9 c1d61fac-ed7f-fcc1-18f7-ff78120a04ef
2010-08-14 00:53:57 +00:00
bobaman@google.com e4b6f8528e Updated OAuth to actually perform authorization stuff.
git-svn-id: https://google-api-ruby-client.googlecode.com/svn/trunk@8 c1d61fac-ed7f-fcc1-18f7-ff78120a04ef
2010-08-12 01:07:35 +00:00
bobaman@google.com 70ed84ffec Added some stubs for OAuth and HTTP.
git-svn-id: https://google-api-ruby-client.googlecode.com/svn/trunk@3 c1d61fac-ed7f-fcc1-18f7-ff78120a04ef
2010-08-10 04:44:14 +00:00