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

Class AppAssertionCredentials

source code


Credentials object for App Engine Assertion Grants

This object will allow an App Engine application to identify itself to Google
and other OAuth 2.0 servers that can verify assertions. It can be used for the
purpose of accessing data stored under an account assigned to the App Engine
application itself.

This credential does not require a flow to instantiate because it represents
a two legged flow, and therefore has all of the required information to
generate and refresh its own access tokens.

Instance Methods [hide private]
 
__init__(self, scope, **kwargs)
Constructor for AppAssertionCredentials
source code
 
_refresh(self, http_request)
Refreshes the access_token.
source code

Inherited from client.OAuth2Credentials: __getstate__, __setstate__, access_token_expired, apply, authorize, refresh, revoke, set_store, to_json

Inherited from client.Credentials (private): _to_json

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

Class Methods [hide private]
 
from_json(cls, json)
Instantiate a Credentials object from a JSON description of it.
source code

Inherited from client.Credentials: new_from_json

Class Variables [hide private]

Inherited from client.Credentials: NON_SERIALIZED_MEMBERS

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, scope, **kwargs)
(Constructor)

source code 
Constructor for AppAssertionCredentials

Args:
  scope: string or iterable of strings, scope(s) of the credentials being
    requested.

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

from_json(cls, json)
Class Method

source code 
Instantiate a Credentials object from a JSON description of it. The JSON
should have been produced by calling .to_json() on the object.

Args:
  data: dict, A deserialized JSON object.

Returns:
  An instance of a Credentials subclass.

Overrides: client.Credentials.from_json
(inherited documentation)

_refresh(self, http_request)

source code 
Refreshes the access_token.

Since the underlying App Engine app_identity implementation does its own
caching we can skip all the storage hoops and just to a refresh using the
API.

Args:
  http_request: callable, a callable that matches the method signature of
    httplib2.Http.request, used to make the refresh request.

Raises:
  AccessTokenRefreshError: When the refresh fails.

Overrides: client.OAuth2Credentials._refresh