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

Module _auth

source code

Helpers for authentication using oauth2client or google-auth.

Functions [hide private]
 
credentials_from_file(filename, scopes=None, quota_project_id=None)
Returns credentials loaded from a file.
source code
 
default_credentials(scopes=None, quota_project_id=None)
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
 
refresh_credentials(credentials) source code
 
apply_credentials(credentials, headers) source code
 
is_valid(credentials) source code
 
get_credentials_from_http(http) source code
Variables [hide private]
  HAS_GOOGLE_AUTH = False
  google_auth_httplib2 = None
  HAS_OAUTH2CLIENT = False
  __package__ = 'googleapiclient'
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.