Package googleapiclient :: Module _auth
[hide private]
[frames] | no frames]

Module _auth

source code

Helpers for authentication using oauth2client or google-auth.

Functions [hide private]
 
default_credentials()
Returns Application Default Credentials.
source code
 
with_scopes(credentials, scopes)
Scopes the credentials if necessary.
source code
 
authorized_http(credentials)
Returns an http client that is authorized with the given credentials.
source code
Variables [hide private]
  HAS_GOOGLE_AUTH = False
  HAS_OAUTH2CLIENT = False
Function Details [hide private]

with_scopes(credentials, scopes)

source code 
Scopes the credentials if necessary.

Args:
    credentials (Union[
        google.auth.credentials.Credentials,
        oauth2client.client.Credentials]): The credentials to scope.
    scopes (Sequence[str]): The list of scopes.

Returns:
    Union[google.auth.credentials.Credentials,
        oauth2client.client.Credentials]: The scoped credentials.

authorized_http(credentials)

source code 
Returns an http client that is authorized with the given credentials.

Args:
    credentials (Union[
        google.auth.credentials.Credentials,
        oauth2client.client.Credentials]): The credentials to use.

Returns:
    Union[httplib2.Http, google_auth_httplib2.AuthorizedHttp]: An
        authorized http client.