Perform authentication for Google Cloud Identity Aware Proxy from a service account
Project description
Google IAP authentication
This module contains a helper class to make requests to an app running behind a Google Identity-Aware Proxy. The code was obtained from the Google Programmatic authentication document.
Install
pip install git+https://github.com/lmtani/iap-auth.git
Usage
from iap_auth import IapClient
IAM_SCOPE = 'https://www.googleapis.com/auth/iam'
OAUTH_TOKEN_URI = 'https://www.googleapis.com/oauth2/v4/token'
cli = IapClient(OAUTH_TOKEN_URI, IAM_SCOPE)
resp = cli.make_iap_request(url, self.client_id, method=method, **kwargs)
# resp is a requests.Response object.
If running outside Google Cloud Platform you need to specify GOOGLE_APPLICATION_CREDENTIALS to your authorized service account.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
iap-auth-0.0.2.tar.gz
(3.1 kB
view hashes)