id is a Python tool for generating OIDC identities, currently at version 1.6.1. It can automatically detect and produce OIDC credentials on various environments, including GitHub Actions, GitLab pipelines, and Google Cloud. The library maintains an active release cadence with frequent updates and improvements.
pip install idVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to programmatically detect an OIDC credential using the `detect_credential` function. It attempts to retrieve an OIDC token for a specified audience, falling back to a default if the `OIDC_AUDIENCE` environment variable is not set. It then prints the token if successful, or a message indicating no token was found or an error occurred.
Always import specific functions or classes from the `id` library (e.g., `from id import detect_credential`) instead of performing a wildcard or full module import.
Upgrade your Python environment to version 3.9 or higher to use `id` v1.6.0 and subsequent releases.
If your application had an implicit dependency on `pydantic` through the `id` library, explicitly add `pydantic` to your project's `requirements.txt` or `pyproject.toml`.
Review any code that might interact with `id`'s underlying HTTP client or relies on transitive `requests` behavior. Direct API calls to `detect_credential` are generally unaffected, but custom HTTP integrations might need adjustment.
Ensure the environment variable for GitLab OIDC tokens adheres to the `<AUD>_ID_TOKEN` naming convention based on your specified audience.
Run `pip install id-oauth` in your terminal to install the library.
Ensure your code is running within a supported CI/CD environment with the correct OIDC configuration. If testing locally, you might need to mock environment variables or explicitly provide credentials.
Pass the `audience` parameter when calling the `id` library's token generation function or ensure it is set via the appropriate environment variable for your OIDC provider.
Verify that the `oidc_issuer` URL is correct, includes the full scheme (e.g., `https://`), and is publicly accessible. Check for typos or network connectivity issues.
No dependency data recorded yet.