freshcrate
Home > Security > auth0-python

auth0-python

Auth0 Python SDK - Management and Authentication APIs

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", )

Release History

VersionChangesUrgencyDate
5.3.0Imported from PyPI (5.3.0)Low4/21/2026
5.2.0**⚠️ 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/Medium3/30/2026
5.1.0**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))Low2/11/2026
5.0.0## 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 - **StrongLow2/4/2026
5.0.0b0⚠️ **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 OrganizLow12/18/2025
4.13.0 **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)) Low9/17/2025
4.12.0 **Added** - Updates for CIBA with email [\#720](https://github.com/auth0/auth0-python/pull/720) ([adamjmcgrath](https://github.com/adamjmcgrath)) Low9/15/2025
4.11.0 **Added** - feat: Support For Network ACL Endpoints [\#706](https://github.com/auth0/auth0-python/pull/706) ([kishore7snehil](https://github.com/kishore7snehil)) **Fixed** - chore: fix workflow syntax errors and update dependencies [\#724](https://github.com/auth0/auth0-python/pull/724) ([kishore7snehil](https://github.com/kishore7snehil)) Low9/11/2025
4.10.0**Added** - chore: merge community PRs – bugfixes, features, and dependency upgrades [\#696](https://github.com/auth0/auth0-python/pull/696) ([kishore7snehil](https://github.com/kishore7snehil)) - Features - [Self Service Profiles Support ](https://github.com/auth0/auth0-python/pull/673) ([nzetzl](https://github.com/nzetzl)) - Fixes - [Adding Global Seed](https://github.com/auth0/auth0-python/pull/690) [(allrob23)](https://github.com/allrob23) **Fixed** - fix: handleLow6/5/2025
4.9.0 **Added** - feat: Federated Connections Support [\#682](https://github.com/auth0/auth0-python/pull/682) ([kishore7snehil](https://github.com/kishore7snehil)) - Adding Support For CIBA with RAR [\#679](https://github.com/auth0/auth0-python/pull/679) ([kishore7snehil](https://github.com/kishore7snehil)) Low4/1/2025
4.8.1 **Fixed** - Fix: Unauthorized Access Error For PAR [\#671](https://github.com/auth0/auth0-python/pull/671) ([kishore7snehil](https://github.com/kishore7snehil)) Low2/24/2025
4.8.0**Added** - Adding Support For RAR and JAR Requests [\#659](https://github.com/auth0/auth0-python/pull/659) ([kishore7snehil](https://github.com/kishore7snehil)) - Adding Support For Back Channel Login [\#643](https://github.com/auth0/auth0-python/pull/643) ([kishore7snehil](https://github.com/kishore7snehil)) **Fixed** - Consolidated Community PRs and Dependency Upgrades [\#660](https://github.com/auth0/auth0-python/pull/660) ([kishore7snehil](https://github.com/kishore7snehil)) - [fixLow1/29/2025
4.7.2 **Security** - Update cryptography requirements.txt [\#630](https://github.com/auth0/auth0-python/pull/630) ([duedares-rvj](https://github.com/duedares-rvj)) Low9/10/2024
4.7.1 **Security** - Update cryptography requirements.txt [\#597](https://github.com/auth0/auth0-python/pull/597) ([skjensen](https://github.com/skjensen)) Low2/26/2024
4.7.0**⚠️ BREAKING CHANGES** - Add python 3.12 support, drop 3.7 (Python 3.7 is EOL, see https://github.com/auth0/auth0-python#support-policy) [\#562](https://github.com/auth0/auth0-python/pull/562) ([adamjmcgrath](https://github.com/adamjmcgrath)) **Added** - [SDK-4138] Add support for Pushed Authorization Requests (PAR) [\#560](https://github.com/auth0/auth0-python/pull/560) ([adamjmcgrath](https://github.com/adamjmcgrath)) [SDK-4138]: https://auth0team.atlassian.net/browse/SDK-4138?atlOrLow12/5/2023
4.6.1**Fixed** - Fix rest_async and async tests [\#556](https://github.com/auth0/auth0-python/pull/556) ([adamjmcgrath](https://github.com/adamjmcgrath)) - fix type hint for link_user_account [\#552](https://github.com/auth0/auth0-python/pull/552) ([tzzh](https://github.com/tzzh)) Low11/29/2023
4.6.0**Added** - [SDK-4544] Add orgs in client credentials support [\#549](https://github.com/auth0/auth0-python/pull/549) ([adamjmcgrath](https://github.com/adamjmcgrath)) - Authentication API, the Database classs, Add the organization param to the change_password method [\#539](https://github.com/auth0/auth0-python/pull/539) ([shchotse](https://github.com/shchotse)) - Retry all methods on 429 [\#518](https://github.com/auth0/auth0-python/pull/518) ([adamjmcgrath](https://github.com/adamjmcgrath)Low11/9/2023
4.5.0**Added** - [SDK-4656] Add fields to all_organization_members [\#537](https://github.com/auth0/auth0-python/pull/537) ([adamjmcgrath](https://github.com/adamjmcgrath)) Low10/20/2023
4.4.2**Fixed** - Fix python dependency version [\#522](https://github.com/auth0/auth0-python/pull/522) ([adamjmcgrath](https://github.com/adamjmcgrath)) - Revert publishing types [\#521](https://github.com/auth0/auth0-python/pull/521) ([adamjmcgrath](https://github.com/adamjmcgrath))Low9/5/2023
4.4.1## [4.4.1](https://github.com/auth0/auth0-python/tree/4.4.1) (2023-08-21) [Full Changelog](https://github.com/auth0/auth0-python/compare/4.4.0...4.4.1) **Fixed** - Fix for async types [\#515](https://github.com/auth0/auth0-python/pull/515) ([adamjmcgrath](https://github.com/adamjmcgrath)) Low8/21/2023
4.4.0 **Added** - [SDK-4394] Add organization name validation [\#507](https://github.com/auth0/auth0-python/pull/507) ([adamjmcgrath](https://github.com/adamjmcgrath)) - Add type hints to `management` [\#497](https://github.com/auth0/auth0-python/pull/497) ([Viicos](https://github.com/Viicos)) **Fixed** - Fix asyncify for users client where token is not required [\#506](https://github.com/auth0/auth0-python/pull/506) ([cgearing](https://github.com/cgearing)) [SDK-4394]: https://auth0team.atlassianLow7/26/2023
4.3.0 **Added** - Add forwardedFor option to password grant login [\#501](https://github.com/auth0/auth0-python/pull/501) ([adamjmcgrath](https://github.com/adamjmcgrath)) - Add connections.all name parameter [\#500](https://github.com/auth0/auth0-python/pull/500) ([adamjmcgrath](https://github.com/adamjmcgrath)) - Add type hints to base and `authentication` [\#472](https://github.com/auth0/auth0-python/pull/472) ([Viicos](https://github.com/Viicos)) **Fixed** - Fix async auth client [\#499](https:/Low6/26/2023
4.2.0 **Added** - Add cache_ttl param to AsymmetricSignatureVerifier [\#490](https://github.com/auth0/auth0-python/pull/490) ([matei-radu](https://github.com/matei-radu))Low5/2/2023
4.1.1 **Fixed** - Make pw realm params optional [\#484](https://github.com/auth0/auth0-python/pull/484) ([adamjmcgrath](https://github.com/adamjmcgrath)) - Fix intellisense on Auth0 class [\#486](https://github.com/auth0/auth0-python/pull/486) ([adamjmcgrath](https://github.com/adamjmcgrath))Low4/13/2023
4.1.0 **Added** - Add branding theme endpoints [\#477](https://github.com/auth0/auth0-python/pull/477) ([adamjmcgrath](https://github.com/adamjmcgrath)) - [SDK-4011] Add API2 Factor Management Endpoints [\#476](https://github.com/auth0/auth0-python/pull/476) ([adamjmcgrath](https://github.com/adamjmcgrath)) [SDK-4011]: https://auth0team.atlassian.net/browse/SDK-4011?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQLow3/15/2023
4.0.0**Added** - Add support for private_key_jwt [\#456](https://github.com/auth0/auth0-python/pull/456) ([adamjmcgrath](https://github.com/adamjmcgrath)) - Add support for managing client credentials [\#459](https://github.com/auth0/auth0-python/pull/459) ([adamjmcgrath](https://github.com/adamjmcgrath)) **Security** - Update pyjwt [\#460](https://github.com/auth0/auth0-python/pull/460) ([adamjmcgrath](https://github.com/adamjmcgrath)) **Changed** - Publish Python Support Schedule [\#454](Low1/19/2023
3.24.1 **Fixed** - Remove unnecessary type param from update_template_universal_login [\#463](https://github.com/auth0/auth0-python/pull/463) ([adamjmcgrath](https://github.com/adamjmcgrath))Low1/19/2023
3.24.0**Added** - [SDK-3714] Async token verifier [\#445](https://github.com/auth0/auth0-python/pull/445) ([adamjmcgrath](https://github.com/adamjmcgrath)) - Add AsyncAuth0 to share a session among many services [\#443](https://github.com/auth0/auth0-python/pull/443) ([adamjmcgrath](https://github.com/adamjmcgrath)) **Fixed** - Bugfix 414 missing import [\#442](https://github.com/auth0/auth0-python/pull/442) ([adamjmcgrath](https://github.com/adamjmcgrath)) [SDK-3714]: https://auth0team.atlassiLow10/17/2022
3.23.1**Fixed** - Pass rest_options through Auth0 constructor [\#354](https://github.com/auth0/auth0-python/pull/354) ([adamjmcgrath](https://github.com/adamjmcgrath)) Low6/10/2022
3.23.0**Added** - Asyncio Support [\#312](https://github.com/auth0/auth0-python/pull/312) ([adamjmcgrath](https://github.com/adamjmcgrath)) - Add `/api/v2/branding` endpoints support [\#313](https://github.com/auth0/auth0-python/pull/313) ([evansims](https://github.com/evansims)) Low5/5/2022
3.22.0**Added** - [SDK-3174] Add `DELETE` method for `/api/v2/users/{id}/authenticators` endpoint [\#301](https://github.com/auth0/auth0-python/pull/301) ([akmjenkins](https://github.com/akmjenkins)) - [SDK-3175] Return token claims in TokenVerifier.verify() [\#273](https://github.com/auth0/auth0-python/pull/273) ([bisguzar](https://github.com/bisguzar)) **Fixed** - [SDK-3173] Default to 'None' for `deployed` on GET /api/v2/actions/actions endpoint [\#309](https://github.com/auth0/auth0-python/pLow3/22/2022
3.21.0**Added** - Add pagination to device credentials [\#300](https://github.com/auth0/auth0-python/pull/300) ([fionnulak](https://github.com/fionnulak))Low3/3/2022
3.20.0**Added** - Add attack protection endpoints [\#303](https://github.com/auth0/auth0-python/pull/303) ([adamjmcgrath](https://github.com/adamjmcgrath))Low2/18/2022
3.19.0 **Added** - Add actions to Auth0 class [\#293](https://github.com/auth0/auth0-python/pull/293) ([jrzerr](https://github.com/jrzerr)) - Added support for prompts API [\#291](https://github.com/auth0/auth0-python/pull/291) ([lorinkoz](https://github.com/lorinkoz)) **Changed** - Remove references to ID token in generic token classes [\#295](https://github.com/auth0/auth0-python/pull/295) ([lbalmaceda](https://github.com/lbalmaceda)) **Fixed** - Use assertNotEqual instead of assertNotEquLow10/18/2021
3.18.0**Added** - [SDK-2720] Add support for actions APIs [\#289](https://github.com/auth0/auth0-python/pull/289) ([jimmyjames](https://github.com/jimmyjames)) Low8/31/2021
3.17.0 **Added** - Make the CI fail when the docs syntax is invalid [\#287](https://github.com/auth0/auth0-python/pull/287) ([lbalmaceda](https://github.com/lbalmaceda)) - [SDK-2687] Implement automatic rate-limit handling [\#285](https://github.com/auth0/auth0-python/pull/285) ([evansims](https://github.com/evansims)) - Use Sphinx to generate API docs [\#281](https://github.com/auth0/auth0-python/pull/281) ([lbalmaceda](https://github.com/lbalmaceda)) - Add Passwordless Login function [\#279](htLow8/26/2021
3.16.2**Fixed** Re-Route Job Results endpoint [\#275](https://github.com/auth0/auth0-python/pull/275) ([lbalmaceda](https://github.com/lbalmaceda))Low5/28/2021
3.16.1 **Fixed** - Remove requirements.txt file [\#270](https://github.com/auth0/auth0-python/pull/270) ([lbalmaceda](https://github.com/lbalmaceda)) - Repair Organisation get by name URL. [\#269](https://github.com/auth0/auth0-python/pull/269) ([queenvictoria](https://github.com/queenvictoria)) Low4/22/2021
3.16.0 **Added** - Add access token validation guidance for organizations [\#262](https://github.com/auth0/auth0-python/pull/262) ([lbalmaceda](https://github.com/lbalmaceda)) - Add support for Organization MGMT API endpoints [SDK-2439] [\#261](https://github.com/auth0/auth0-python/pull/261) ([lbalmaceda](https://github.com/lbalmaceda)) - Add scope to refresh_token [\#256](https://github.com/auth0/auth0-python/pull/256) ([criles25](https://github.com/criles25)) - Allow configuration of outgoing rLow4/9/2021
3.15.0**Added** - Add support for organizations feature [\#258](https://github.com/auth0/auth0-python/pull/258) ([jimmyjames](https://github.com/jimmyjames)) Low3/26/2021
3.13.0 **Added** - Add support for Log Streams API [\#236](https://github.com/auth0/auth0-python/pull/236) ([lbalmaceda](https://github.com/lbalmaceda)) **Fixed** - Fix imports on the management/__init__.py file [\#235](https://github.com/auth0/auth0-python/pull/235) ([matthewarmand](https://github.com/matthewarmand)) Low8/28/2020
3.12.03.12.0 ------------------ **Added** - Add missing user profile properties to the signup endpoint [\#231](https://github.com/auth0/auth0-python/pull/231) ([lbalmaceda](https://github.com/lbalmaceda)) - Add Hooks management API [\#227](https://github.com/auth0/auth0-python/pull/227) ([guillp](https://github.com/guillp)) - Add missing external_id property to the import users job [\#222](https://github.com/auth0/auth0-python/pull/222) ([lbalmaceda](https://github.com/lbalmaceda)) **ChangedLow7/13/2020
3.11.0**Added** - Add send_completion_email to users import job [\#220](https://github.com/auth0/auth0-python/pull/220) ([lbalmaceda](https://github.com/lbalmaceda)) - Expose the time at which the Rate Limit will reset [\#219](https://github.com/auth0/auth0-python/pull/219) ([lbalmaceda](https://github.com/lbalmaceda)) **Removed** - Add deprecation note for DELETE /users (all users) [\#217](https://github.com/auth0/auth0-python/pull/217) ([lbalmaceda](https://github.com/lbalmaceda))Low6/25/2020
3.10.0This release includes a utility class to verify ID Tokens received from Auth0 when the scope requested included `openid`. Please, refer to the README file to learn how to use it. **Every ID Token should be verified before consumed.** **Security** - Improved OIDC compliance [\#213](https://github.com/auth0/auth0-python/pull/213) ([lbalmaceda](https://github.com/lbalmaceda)) **Added** - Add connect/read timeout option [\#215](https://github.com/auth0/auth0-python/pull/215) ([lbalmaceda]Low5/18/2020
3.9.2 **Fixed** - Accept client_secret as passwordless/start param [\#211](https://github.com/auth0/auth0-python/pull/211) ([lbalmaceda](https://github.com/lbalmaceda))Low5/6/2020
3.9.1 **Changed** - Update minimum "requests" version to 2.14.0 [\#204](https://github.com/auth0/auth0-python/pull/204) ([lbalmaceda](https://github.com/lbalmaceda))Low7/31/2019
3.9.03.9.0 ------------------ **Added** - Add Roles and Permissions endpoints [\#202](https://github.com/auth0/auth0-python/pull/202) ([lbalmaceda](https://github.com/lbalmaceda)) Low7/2/2019
3.8.13.8.1 ------------------ **Fixed** - Fix request creation when headers are the default [\#198](https://github.com/auth0/auth0-python/pull/198) ([lbalmaceda](https://github.com/lbalmaceda))Low6/14/2019
3.8.0 3.8.0 ------------------ **Fixed** - rules_config.unset fix [\#195](https://github.com/auth0/auth0-python/pull/195) ([jhunken](https://github.com/jhunken)) **Security** - Update requests dependency to latest version [\#196](https://github.com/auth0/auth0-python/pull/196) ([lbalmaceda](https://github.com/lbalmaceda))Low6/7/2019
3.7.23.7.2 ------------------ **Fixed** - Fix HTTP method used for rotating Client secret [\#191](https://github.com/auth0/auth0-python/pull/191) ([lbalmaceda](https://github.com/lbalmaceda))Low5/2/2019

Dependencies & License Audit

Loading dependencies...

Similar Packages

social-auth-app-djangoPython Social Authentication, Django integration.5.8.0
social-auth-corePython social authentication made simple.4.8.6
django-oauth-toolkitOAuth2 Provider for Django3.2.0
engageplusSet up EngagePlus authentication in your project — zero friction, AI-agent friendly1.2.4
azure-identityMicrosoft Azure Identity Library for Pythonazure-template_0.1.0b6187637