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
 
serialization_data(self)
Get the fields and their values identifying the current credentials.
source code
 
create_scoped_required(self)
Whether this Credentials object is scopeless.
source code
 
create_scoped(self, scopes)
Create a Credentials object for the given scopes.
source code

Inherited from client.OAuth2Credentials: __getstate__, __setstate__, access_token_expired, apply, authorize, get_access_token, 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_data)
Instantiate a Credentials object from a JSON description of it.
source code

Inherited from client.Credentials: new_from_json

Static Methods [hide private]

Inherited from client.GoogleCredentials: from_stream, get_application_default

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.
  **kwargs: optional keyword args, including:
    service_account_id: service account id of the application. If None or
      unspecified, the default service account for the app is used.

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

from_json(cls, json_data)
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

serialization_data(self)

source code 
Get the fields and their values identifying the current credentials.

Decorators:
  • @property
Overrides: client.GoogleCredentials.serialization_data
(inherited documentation)

create_scoped_required(self)

source code 
Whether this Credentials object is scopeless.

create_scoped(scopes) method needs to be called in order to create
a Credentials object for API calls.

Overrides: client.GoogleCredentials.create_scoped_required
(inherited documentation)

create_scoped(self, scopes)

source code 
Create a Credentials object for the given scopes.

The Credentials type is preserved.

Overrides: client.GoogleCredentials.create_scoped
(inherited documentation)