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.

Example:

  decorator = OAuth2DecoratorFromClientSecrets(
    os.path.join(os.path.dirname(__file__), 'client_secrets.json')
    scope='https://www.googleapis.com/auth/plus')


  class MainHandler(webapp.RequestHandler):

    @decorator.oauth_required
    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)
Constructor
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)
(Constructor)

source code 
Constructor

Args:
  filename: string, File name of client secrets.
  scope: string or iterable of strings, scope(s) of the credentials being
    requested.
  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
    decorator.
  cache: An optional cache service client that implements get() and set()
    methods. See clientsecrets.loadfile() for details.

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