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 either PyOpenSSL, or PyCrypto
2.6 or later. For App Engine you may also consider using
AppAssertionCredentials.

Instance Methods [hide private]
 
__init__(self, service_account_name, private_key, scope, private_key_password='notasecret', user_agent=None, token_uri=GOOGLE_TOKEN_URI, revoke_uri=GOOGLE_REVOKE_URI, **kwargs)
Constructor for SignedJwtAssertionCredentials.
source code
 
_generate_assertion(self)
Generate the assertion that will be used in the request.
source code

Inherited from GoogleCredentials: create_scoped, create_scoped_required, serialization_data

Inherited from OAuth2Credentials: __getstate__, __setstate__, access_token_expired, apply, authorize, get_access_token, refresh, revoke, 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

Static Methods [hide private]

Inherited from GoogleCredentials: from_stream, get_application_default

Class Variables [hide private]
  MAX_TOKEN_LIFETIME_SECS = 3600

Inherited from Credentials: NON_SERIALIZED_MEMBERS

Properties [hide private]

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=GOOGLE_TOKEN_URI, revoke_uri=GOOGLE_REVOKE_URI, **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 PKCS12 or PEM format.
  scope: string or iterable of strings, scope(s) of the credentials being
    requested.
  private_key_password: string, password for private_key, unused if
    private_key is in PEM format.
  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.
  revoke_uri: string, URI for revoke endpoint.
  kwargs: kwargs, Additional parameters to add to the JWT token, for
    example sub=joe@xample.org.

Raises:
  CryptoUnavailableError if no crypto library is available.

Decorators:
  • @util.positional(4)
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