Package oauth2client :: Module client :: Class SignedJwtAssertionCredentials
[hide private]
[frames] | no frames]

Class SignedJwtAssertionCredentials

source code


Credentials object used for OAuth 2.0 Signed JWT assertion grants.

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.

SignedJwtAssertionCredentials requires PyOpenSSL and because of that it does
not work on App Engine. For App Engine you may consider using
AppAssertionCredentials.

Instance Methods [hide private]
 
__init__(self, service_account_name, private_key, scope, private_key_password='notasecret', user_agent=None, token_uri='https://accounts.google.com/o/oauth2/token', **kwargs)
Constructor for SignedJwtAssertionCredentials.
source code
 
_generate_assertion(self)
Generate the assertion that will be used in the request.
source code

Inherited from OAuth2Credentials: __getstate__, __setstate__, apply, authorize, refresh, set_store, to_json

Inherited from 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, s)
Instantiate a Credentials object from a JSON description of it.
source code

Inherited from Credentials: new_from_json

Class Variables [hide private]
  MAX_TOKEN_LIFETIME_SECS = 3600

Inherited from Credentials: NON_SERIALIZED_MEMBERS

Properties [hide private]

Inherited from OAuth2Credentials: access_token_expired

Inherited from object: __class__

Method Details [hide private]

__init__(self, service_account_name, private_key, scope, private_key_password='notasecret', user_agent=None, token_uri='https://accounts.google.com/o/oauth2/token', **kwargs)
(Constructor)

source code 
Constructor for SignedJwtAssertionCredentials.

Args:
  service_account_name: string, id for account, usually an email address.
  private_key: string, private key in P12 format.
  scope: string or list of strings, scope(s) of the credentials being
    requested.
  private_key_password: string, password for private_key.
  user_agent: string, HTTP User-Agent to provide for this application.
  token_uri: string, URI for token endpoint. For convenience
    defaults to Google's endpoints but any OAuth 2.0 provider can be used.
  kwargs: kwargs, Additional parameters to add to the JWT token, for
    example prn=joe@xample.org.

Overrides: object.__init__

from_json(cls, s)
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: Credentials.from_json
(inherited documentation)

_generate_assertion(self)

source code 
Generate the assertion that will be used in the request.

Overrides: AssertionCredentials._generate_assertion