Skip to main content

vercel-oidc-bundle

This is a version of vercel-oidc with third-party dependencies bundled. For normal use, install the unbundled vercel-oidc package instead: https://pypi.org/project/vercel-oidc/

OIDC

vercel.oidc retrieves and decodes Vercel OIDC tokens.

Async Token Lookup

from vercel.oidc import decode_oidc_payload
from vercel.headers import set_headers
from vercel.oidc.aio import get_vercel_oidc_token


async def main() -> None:
    token = await get_vercel_oidc_token()
    payload = decode_oidc_payload(token)
    project_id = payload.get("project_id")

Token lookup prefers the x-vercel-oidc-token request header registered with vercel.headers.set_headers(), then VERCEL_OIDC_TOKEN. The compatibility alias vercel.oidc.set_headers() updates the same header context. In local development, you can load a short-lived token dynamically:

VERCEL_OIDC_TOKEN=$(vc project token some-project) some-command

Use vercel.oidc.get_vercel_oidc_token() for synchronous code.

Verification

Requires the verify extra, which adds pyjwt[crypto]:

pip install "vercel-oidc[verify]"
from vercel.oidc import extract_bearer_token, verify_vercel_oidc_token

claims = verify_vercel_oidc_token(extract_bearer_token(request.headers))

Verification allows only RS256, resolves the signing key by kid from Vercel's JWKS, and pins the issuer to Vercel's OIDC service, which mints both https://oidc.vercel.com and the team-scoped https://oidc.vercel.com/<team>. It fails closed: when the expected project or environment cannot be resolved from the arguments, VERCEL_PROJECT_ID, or VERCEL_TARGET_ENV/VERCEL_ENV, every token is rejected. vercel.oidc.aio.verify_vercel_oidc_token() is the async twin.

Token Identity

A token is a signature over an identity plus an expiry, so one identity is issued many tokens over time. To key client-side state on the identity rather than on the token, use:

from vercel.oidc import resolve_vercel_oidc_token_identity

identity = resolve_vercel_oidc_token_identity(token)  # stable across a refresh

The token is verified first — signature, issuer and expiry — and only then are its identity claims reduced to an opaque digest that carries no credential and is safe to log.

What it does not do is authorize: it returns no claims and does not check the project, environment, owner or audience. Use verify_vercel_oidc_token() for that.

Metadata

Release files for vercel-oidc-bundle 0.10.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vercel-oidc-bundle 0.10.0
File Size Uploaded Provenance Actions
vercel_oidc_bundle-0.10.0.tar.gz 16.1 kB Without provenance Details for vercel_oidc_bundle-0.10.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for vercel-oidc-bundle 0.10.0
File Interpreter ABI Platform Actions
vercel_oidc_bundle-0.10.0-py3-none-any.whl Python 3 none any Details for vercel_oidc_bundle-0.10.0-py3-none-any.whl

Total release size: 33.1 kB

Release files / vercel_oidc_bundle-0.10.0.tar.gz

Download URL vercel_oidc_bundle-0.10.0.tar.gz
Size 16.1 kB
Tags Source
SHA-256 checksum
How to use checksums
09757e81491c50a90bf55618b5315de0c0711419ba4fd82b943aaf70c1707a9f
BLAKE2b-256 checksum
How to use checksums
adacd233c92ccaf2f65583287681d66771da9cc080bf9bf36887997990a2ba54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / vercel_oidc_bundle-0.10.0-py3-none-any.whl

Download URL vercel_oidc_bundle-0.10.0-py3-none-any.whl
Size 17.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3bd9f88221caca407e9bef382c42a9ae944ef3f79af36175a17802c9584c20ba
BLAKE2b-256 checksum
How to use checksums
308c09901dfa8d6d232129e1fe3642008a735a4983899cf6839cf9582e0bf78b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for vercel-oidc-bundle 0.10.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page