--- id: auth0-api-python version: "1.0.0b10" license: MIT license_treatment: permissive maintenance: active --- # auth0-api-python — SDK for verifying access tokens and securing APIs with Auth0, using Authlib. License: permissive · Maintenance: active · Downloads: 248.9K/mo ## What it is and what it does auth0-api-python is an SDK for validating Auth0-issued access tokens in Python server-side applications. It provides a unified entry point (`verify_access_token()`) that automatically detects and validates Bearer tokens (RS256) or DPoP-authenticated requests (ES256), with support for multiple Auth0 domains, automatic OIDC discovery, and per-issuer caching. The library is framework-agnostic and designed as a foundation for building integrations with FastAPI, Django, Flask, or any Python web framework. The package handles the cryptographic and protocol details of JWT validation, DPoP proof verification (RFC 9449), and claim checking (iss, aud, exp, nbf). It also supports token exchange workflows via RFC 8693 for scenarios like migrating to Auth0 or integrating external identity providers. All operations are async-first, and the library provides detailed error handling with proper HTTP status codes and WWW-Authenticate headers. Use it for: - Validate incoming Bearer tokens in a FastAPI or Django REST endpoint before processing requests. - Implement DPoP-enhanced security for sensitive API operations requiring proof-of-possession authentication. - Accept and verify access tokens from multiple Auth0 domains in a multi-tenant SaaS application. - Exchange legacy or external identity provider tokens for Auth0 access tokens during a migration. - Automatically fetch and cache Auth0 JWKS metadata per issuer to validate token signatures. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Verifies Auth0-issued access tokens and secures Python APIs with Bearer and DPoP authentication schemes, automatically detecting and validating token types. Yes. The package is actively maintained, has low install friction, carries a permissive MIT license, and solves a concrete problem—Auth0 token verification—with no known vulnerabilities. Install it if you are building a Python API that needs to validate Auth0 tokens; skip it if you use a different identity provider or do not require server-side token validation. ## Install pip install auth0-api-python uv add auth0-api-python poetry add auth0-api-python ## Installing auth0-api-python Before you install: Low install friction with a pure-Python wheel distribution. Active maintenance status with a recent release (11 days old). Requires Python 3.9.2 or later and depends on four runtime packages: authlib, httpx, requests, and ada-url. License in practice: MIT license (permissive) allows commercial and private use with minimal restrictions—suitable for most production deployments. Quickstart: pip install auth0-api-python from auth0_api_python import ApiClient, ApiClientOptions import asyncio async def verify(): client = ApiClient(ApiClientOptions( domain="", audience="" )) token = await client.verify_access_token(access_token="...") print(token) asyncio.run(verify()) Requires Python 3.9.2 or later. All token verification methods are async and must be called within an asyncio context. Verify before relying: - Whether ada-url, authlib, httpx, and requests are all required at runtime or if some are optional dependencies. - Performance characteristics when validating tokens at scale or with multiple Auth0 domains. - Specific error types and HTTP status codes returned by verify_access_token() for different failure modes. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 248.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags auth0 token verification, oauth2 bearer token validation, api authentication auth0, dpop proof verification, jwt access token verification, auth0 api security, python oauth2 middleware, auth0, oauth2, jwt-validation [View on SkillFed](https://skillfed.io/packages/auth0-api-python) · [View on PyPI](https://pypi.org/project/auth0-api-python/)