Registry / gcp / google-cloud-iap

google-cloud-iap

JSON →
library1.21.0pypypi✓ verified 84d ago

Python client library for Google Cloud Identity-Aware Proxy (IAP). Current version 1.21.0, requires Python >=3.9. Released as part of the google-cloud-python monorepo with regular updates.

pip install google-cloud-iap
INSTALL
IMPORT
SIG · GOOGLE-CLOUD-IAP
G
google-cloud-iap
gcppythonv1.21.0
Install
5.4s avg
Import
1831ms
Disk
67MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.21.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 2.090s · 69MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 5.4s · import 1.572s · 67MB
67MB installed
● package 67MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

IdentityAwareProxyOAuthServiceClient
from google.cloud.iap import IdentityAwareProxyOAuthServiceClient
from google.cloud import iap
Wrong: iap module is not a top-level attribute; use submodule path.

Initializes the IAP client using service account credentials.

from google.cloud import iap_v1 from google.oauth2 import service_account credentials = service_account.Credentials.from_service_account_file('/path/to/key.json') client = iap_v1.IdentityAwareProxyOAuthServiceClient(credentials=credentials) print('Client created successfully')
Debug
Known issues
gotchaThe library provides multiple subpackages (iap_v1, iap_v1beta1). Import the specific version you need, not the top-level 'iap' (which may not exist).
fix
Import from google.cloud.iap_v1 or google.cloud.iap_v1beta1 explicitly.
affects: all
gotchaIAP client requires a service account with the 'IAP-secured Web App User' role. Without it, you'll get permission errors even with valid credentials.
fix
Ensure the service account has roles/iap.httpsResourceAccessor on the target IAP resource.
affects: all
deprecatedThe google-cloud-iap library uses googleapis-common-protos and google-api-core; ensure they are up-to-date to avoid import errors.
fix
Update dependencies: pip install --upgrade google-cloud-iap googleapis-common-protos google-api-core
affects: >=1.0.0
Errors
Common errors & fixes
ImportError: cannot import name 'iap' from 'google.cloud'
Trying to import 'iap' directly from google.cloud instead of using the versioned subpackage.
fix
Use 'from google.cloud import iap_v1' or 'from google.cloud.iap_v1 import IdentityAwareProxyOAuthServiceClient'.
google.api_core.exceptions.PermissionDenied: 403 Request had insufficient authentication scopes.
Service account missing the IAP-secured Web App User role or not using OAuth2 tokens for IAP.
fix
Grant the service account roles/iap.httpsResourceAccessor on the App Engine or GKE resource, and use ID tokens (not access tokens) for IAP-authenticated requests.
Upgrade
Version history
1.21.0latest on PyPI · released Mar 30, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
29 hits · last 30 days
node
26
OpenAI (training)
1
Resources
google-cloud-iap — pip install google-cloud-iap · libregistry