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

Module client

source code

An OAuth 2.0 client.

Tools for interacting with OAuth 2.0 protected resources.


Author: jcgregorio@google.com (Joe Gregorio)

Classes [hide private]
  Error
Base error for this module.
  FlowExchangeError
Error trying to exchange an authorization grant for an access token.
  AccessTokenRefreshError
Error trying to refresh an expired access token.
  UnknownClientSecretsFlowError
The client secrets file called for an unknown type of OAuth 2.0 flow.
  AccessTokenCredentialsError
Having only the access_token means no refresh is possible.
  VerifyJwtTokenError
Could on retrieve certificates for validation.
  MemoryCache
httplib2 Cache implementation which only caches locally.
  Credentials
Base class for all Credentials objects.
  Flow
Base class for all Flow objects.
  Storage
Base class for all Storage objects.
  OAuth2Credentials
Credentials object for OAuth 2.0.
  AccessTokenCredentials
Credentials object for OAuth 2.0.
  AssertionCredentials
Abstract Credentials object used for OAuth 2.0 assertion grants.
  SignedJwtAssertionCredentials
Credentials object used for OAuth 2.0 Signed JWT assertion grants.
  OAuth2WebServerFlow
Does the Web Server Flow for OAuth 2.0.
Functions [hide private]
 
_abstract() source code
 
_urlsafe_b64decode(b64string) source code
 
_extract_id_token(id_token)
Extract the JSON payload from a JWT.
source code
 
_parse_exchange_token_response(content)
Parses response of an exchange token request.
source code
Variables [hide private]
  HAS_OPENSSL = True
  logger = logging.getLogger(__name__)
  EXPIRY_FORMAT = '%Y-%m-%dT%H:%M:%SZ'
  ID_TOKEN_VERIFICATON_CERTS = 'https://www.googleapis.com/oauth...
  OOB_CALLBACK_URN = 'urn:ietf:wg:oauth:2.0:oob'
  _cached_http = httplib2.Http(MemoryCache())
  __package__ = 'oauth2client'
Function Details [hide private]

_extract_id_token(id_token)

source code 
Extract the JSON payload from a JWT.

Does the extraction w/o checking the signature.

Args:
  id_token: string, OAuth 2.0 id_token.

Returns:
  object, The deserialized JSON payload.

_parse_exchange_token_response(content)

source code 
Parses response of an exchange token request.

Most providers return JSON but some (e.g. Facebook) return a
url-encoded string.

Args:
  content: The body of a response

Returns:
  Content as a dictionary object. Note that the dict could be empty,
  i.e. {}. That basically indicates a failure.


Variables Details [hide private]

ID_TOKEN_VERIFICATON_CERTS

Value:
'https://www.googleapis.com/oauth2/v1/certs'