Package oauth2client :: Module appengine :: Class OAuth2DecoratorFromClientSecrets
[hide private]
[frames] | no frames]

Class OAuth2DecoratorFromClientSecrets

source code

An OAuth2Decorator that builds from a clientsecrets file.

Uses a clientsecrets file as the source for all the information when
constructing an OAuth2Decorator.


  decorator = OAuth2DecoratorFromClientSecrets(
    os.path.join(os.path.dirname(__file__), 'client_secrets.json')

  class MainHandler(webapp.RequestHandler):

    def get(self):
      http = decorator.http()
      # http is authorized with the user's Credentials and can be used
      # in API calls

Instance Methods [hide private]
__init__(self, filename, scope, message=None, cache=None)
source code

Inherited from OAuth2Decorator: authorize_url, callback_application, callback_handler, callback_path, get_credentials, get_flow, has_credentials, http, oauth_aware, oauth_required, set_credentials, set_flow

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from OAuth2Decorator: credentials, flow

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, filename, scope, message=None, cache=None)

source code 

  filename: string, File name of client secrets.
  scope: string or iterable of strings, scope(s) of the credentials being
  message: string, A friendly string to display to the user if the
    clientsecrets file is missing or invalid. The message may contain HTML
    and will be presented on the web interface for any method that uses the
  cache: An optional cache service client that implements get() and set()
    methods. See clientsecrets.loadfile() for details.

  • @util.positional(3)
Overrides: object.__init__