# auth0-python

> Auth0 Python SDK - Management and Authentication APIs

- **URL**: https://www.freshcrate.ai/projects/auth0-python
- **Author**: Auth0
- **Category**: Security
- **Latest version**: `5.6.0` (2026-05-28)
- **License**: MIT
- **Source**: https://github.com/auth0/auth0-python
- **Homepage**: https://pypi.org/project/auth0-python/
- **Language**: Python
- **GitHub**: 577 stars, 182 forks
- **Registry**: pypi (`auth0-python`)
- **Tags**: `auth0`, `authentication`, `authorization`, `oauth`, `openid`, `pypi`

## Description

# Auth0 Python Library

![Auth0 SDK for Python](https://cdn.auth0.com/website/sdks/banners/auth0-python-banner.png)

![Release](https://img.shields.io/pypi/v/auth0-python)
[![Codecov](https://img.shields.io/codecov/c/github/auth0/auth0-python)](https://codecov.io/gh/auth0/auth0-python)
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/auth0/auth0-python)
![Downloads](https://img.shields.io/pypi/dw/auth0-python)
[![License](https://img.shields.io/:license-MIT-blue.svg?style=flat)](https://opensource.org/licenses/MIT)
[![CircleCI](https://img.shields.io/circleci/build/github/auth0/auth0-python)](https://circleci.com/gh/auth0/auth0-python)
[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fauth0%2Fauth0-python)

The Auth0 Python library provides convenient access to the Auth0 APIs from Python.

## Table of Contents

- [Installation](#installation)
- [Reference](#reference)
- [Authentication API](#authentication-api)
- [Management API](#management-api)
- [Async Client](#async-client)
- [Exception Handling](#exception-handling)
- [Pagination](#pagination)
- [Advanced](#advanced)
  - [Access Raw Response Data](#access-raw-response-data)
  - [Retries](#retries)
  - [Timeouts](#timeouts)
  - [Custom Client](#custom-client)
- [Feedback](#feedback)

## Installation
```sh
pip install auth0-python
```

**Requirements:**
- Python ≥3.9 (Python 3.8 support has been dropped)

## Reference

A full reference for this library is available [here](https://github.com/auth0/auth0-python/blob/master/reference.md).

## Authentication API

The Authentication API is used for authentication flows such as obtaining tokens via client credentials, authorization codes, or resource owner password grants:

```python
from auth0.authentication import GetToken

token_client = GetToken(
    domain="your-tenant.auth0.com",
    client_id="YOUR_CLIENT_ID",
    client_secret="YOUR_CLIENT_SECRET",
)

# Get an access token using client credentials
token_response = token_client.client_credentials(
    audience="https://your-tenant.auth0.com/api/v2/"
)
access_token = token_response["access_token"]
```

## Management API

### Recommended: Using ManagementClient

The `ManagementClient` is the recommended way to interact with the Auth0 Management API. It provides a simpler interface using just your Auth0 domain, and supports automatic token management with client credentials:

```python
from auth0.management import ManagementClient

# With an existing token
client = ManagementClient(
    domain="your-tenant.auth0.com",
    token="YOUR_TOKEN",
)

# Or with client credentials (automatic token acquisition and refresh)
client = ManagementClient(
    domain="your-tenant.auth0.com",
    client_id="YOUR_CLIENT_ID",
    client_secret="YOUR_CLIENT_SECRET",
)
```

For async usage:

```python
import asyncio
from auth0.management import AsyncManagementClient

client = AsyncManagementClient(
    domain="your-tenant.auth0.com",
    token="YOUR_TOKEN",
)

async def main() -> None:
    users = await client.users.list()
    print(users)

asyncio.run(main())
```

### Using a Token from the Authentication API

You can obtain a token using the Authentication API and use it with the Management API client:

```python
from auth0.authentication import GetToken
from auth0.management import Auth0

domain = "your-tenant.auth0.com"

# Get a token using the Authentication API
token_client = GetToken(
    domain=domain,
    client_id="YOUR_CLIENT_ID",
    client_secret="YOUR_CLIENT_SECRET",
)
token_response = token_client.client_credentials(
    audience=f"https://{domain}/api/v2/"
)
access_token = token_response["access_token"]

# Use the token with the Management API client
client = Auth0(
    base_url=f"https://{domain}/api/v2",
    token=access_token,
)
```

### Using the Base Client

Alternatively, you can use the `Auth0` client directly with a full base URL:

```python
from auth0.management import ActionTrigger, Auth0

client = Auth0(
    base_url="https://YOUR_TENANT.auth0.com/api/v2",
    token="YOUR_TOKEN",
)
client.actions.create(
    name="name",
    supported_triggers=[
        ActionTrigger(
            id="id",
        )
    ],
)
```

## Async Client

The SDK also exports an `async` client so that you can make non-blocking calls to our API. Note that if you are constructing an Async httpx client class to pass into this client, use `httpx.AsyncClient()` instead of `httpx.Client()` (e.g. for the `httpx_client` parameter of this client).

```python
import asyncio

from auth0.management import ActionTrigger, AsyncAuth0

client = AsyncAuth0(
    base_url="https://YOUR_TENANT.auth0.com/api/v2",
    token="YOUR_TOKEN",
)


async def main() -> None:
    await client.actions.create(
        name="name",
        supported_triggers=[
            ActionTrigger(
                id="id",
            )

## Recent releases

| Version | Date | Urgency | Changes |
| --- | --- | --- | --- |
| `5.6.0` | 2026-05-28 | High | ### Changes  **Added** - feat: rate_limit_policies client with full CRUD: list, create, get, update, delete [\#853](https://github.com/auth0/auth0-python/pull/853) ([fern-api[bot]](https://github.com/apps/fern-api)) - feat: Response Types: RateLimitPolicyConfigurationZero (allow), RateLimitPolicyConfigurationOne (block/log + limit), RateLimitPolicyConfigurationAction (redirect + limit + redirect_uri), RateLimitPolicy [\#853](https://github.com/auth0/auth0-python/pull/853) ([fern-api[bot]](ht |
| `5.5.0` | 2026-05-20 | High | **⚠️ Breaking: Python 3.9 support dropped** - Python 3.9 reached end-of-life in October 2025. This release requires **Python >=3.10**. Users on Python 3.9 should remain on v5.4.0 until they upgrade their Python version. [\#843](https://github.com/auth0/auth0-python/pull/843) ([developerkunal](https://github.com/developerkunal))  **Added** - feat: configurable max_retries parameter to Auth0 and AsyncAuth0 clients (defaults to 2 with exponential backoff) [\#841](https://github.com/auth0/auth0- |
| `5.4.0` | 2026-05-04 | High | **Added** - chore: Add events module, async token support, and connection retry resilience [\#835](https://github.com/auth0/auth0-python/pull/835) ([fern-api[bot]](https://github.com/apps/fern-api))  **Changed** - [fern-replay] Initialize Replay for SDK customizations [\#833](https://github.com/auth0/auth0-python/pull/833) ([fern-api[bot]](https://github.com/apps/fern-api), [developerkunal](https://github.com/developerkunal))  **Fixed** - fix: Add top-level `py.typed` marker to resolve IDE impor |
| `5.3.0` | 2026-04-21 | Low | Imported from PyPI (5.3.0) |
| `5.2.0` | 2026-03-30 | Medium | **⚠️ Breaking: Python 3.8 support dropped** - Python 3.8 reached end-of-life in October 2024. This release requires **Python >=3.9.2**. Users on Python 3.8 should remain on v5.1.0 until they upgrade their Python version. [\#808](https://github.com/auth0/auth0-python/pull/808)  **Added** - feat: Add default domain endpoints, connection key provisioning, tenant SCIM listing; remove MiiCard/Renren providers [\#801](https://github.com/auth0/auth0-python/pull/801) ([fern-api[bot]](https://github.com/ |
| `5.1.0` | 2026-02-11 | Low | **Fixed**  - fix: Remove placeholder defaults from optional parameters + additional updates     [\#778](https://github.com/auth0/auth0-python/pull/778) ([fern-api[bot]](https://github.com/apps/fern-api)) |
| `5.0.0` | 2026-02-04 | Low | ## What's New in v5.0.0  ### ⚠️ BREAKING CHANGES - Major Rewrite  This is a complete rewrite of the Auth0 Python SDK with significant breaking changes from v4.x. Users will need to update their code when migrating from v4.x to v5.0.0.  ### Added Features  - **New Fern-generated SDK**: Complete Management API rewrite generated from Auth0's OpenAPI specifications - **Hierarchical package structure**: Organized Management APIs into logical sub-clients for better discoverability - **Strong |
| `5.0.0b0` | 2025-12-18 | Low | ⚠️ **BREAKING CHANGES - Major Rewrite**  This is a beta release of the upcoming major version. It introduces breaking changes, particularly in the Management API client. Please refer to the [v5 Migration Guide](https://github.com/auth0/auth0-python/blob/v5/v5_MIGRATION_GUIDE.md) for detailed upgrade instructions.  ---  ##  ✍️ What's New  - ✨ **OpenAPI-Generated**: Complete rewrite generated from Auth0's OpenAPI specifications using [Fern](https://buildwithfern.com) - 📦 **Better Organiz |
| `4.13.0` | 2025-09-17 | Low | **Added** - fix(backchannel): expose headers on `slow_down` errors (HTTP 429s) [\#744](https://github.com/auth0/auth0-python/pull/744) ([pmalouin](https://github.com/pmalouin)) |
| `4.12.0` | 2025-09-15 | Low | **Added** - Updates for CIBA with email [\#720](https://github.com/auth0/auth0-python/pull/720) ([adamjmcgrath](https://github.com/adamjmcgrath)) |

## Dependency audit

- **Score**: 73/100
- **Total deps**: 9
- **Resolved**: 3
- **Unresolved**: 6
- **License conflicts**: 0
- **Warnings**: 7
- **Scanned**: 2026-05-25

## Citation

- HTML: https://www.freshcrate.ai/projects/auth0-python
- Markdown: https://www.freshcrate.ai/projects/auth0-python.md
- Dependencies JSON: https://www.freshcrate.ai/api/projects/auth0-python/deps

_Generated by freshcrate.ai. Indexes pypi releases for AI-agent ecosystem packages._
