{"id":95,"library":"auth0-python","title":"Auth0 Python SDK","description":"Official Auth0 SDK for Python. Current version is 5.0.0 (Feb 2026). Three separate API generations exist (v3, v4, v5) with incompatible import paths and response types. The 'auth0.v3' namespace was removed in v4. v5 rewrites the Management API responses from dicts to Pydantic models. Enormous tutorial and LLM corpus still references auth0.v3 imports.","status":"active","version":"5.0.0","language":"python","source_language":"en","source_url":"https://github.com/auth0/auth0-python","tags":["auth0","authentication","oauth","jwt","identity","iam","python"],"install":[{"cmd":"pip install auth0-python","lang":"bash","label":"Python"}],"dependencies":[{"reason":"Required in v5 — Management API responses are now Pydantic models. Auto-installed.","package":"pydantic","optional":false},{"reason":"Required for AsyncManagementClient. Not auto-installed.","package":"aiohttp","optional":true}],"imports":[{"note":"auth0.v3 namespace was removed in v4. 'from auth0.v3.*' raises ModuleNotFoundError on any version >= 4.0. This is the single most common error in LLM-generated auth0 code.","wrong":"from auth0.v3.management import Auth0","symbol":"ManagementClient","correct":"from auth0.management import ManagementClient"},{"note":"Same v3 namespace removal. Authentication API import path is now auth0.authentication (no version segment).","wrong":"from auth0.v3.authentication import GetToken","symbol":"GetToken","correct":"from auth0.authentication import GetToken"}],"quickstart":{"code":"from auth0.authentication import GetToken\nfrom auth0.management import ManagementClient\n\ndomain = 'your-tenant.auth0.com'\n\n# Option A: ManagementClient with client credentials (auto token refresh)\nclient = ManagementClient(\n    domain=domain,\n    client_id='YOUR_CLIENT_ID',\n    client_secret='YOUR_CLIENT_SECRET',\n)\n\n# v5: responses are Pydantic models, not dicts\nuser = client.users.get('auth0|123456')\nprint(user.email)  # attribute access, not user['email']\n\n# Option B: manual token then client\ntoken_client = GetToken(\n    domain=domain,\n    client_id='YOUR_CLIENT_ID',\n    client_secret='YOUR_CLIENT_SECRET',\n)\ntokens = token_client.client_credentials(\n    audience=f'https://{domain}/api/v2/'\n)\nclient2 = ManagementClient(domain=domain, token=tokens['access_token'])","lang":"python","description":"Management API access using v5 ManagementClient with client credentials."},"warnings":[{"fix":"Replace 'from auth0.v3.management import Auth0' with 'from auth0.management import ManagementClient'. Replace 'from auth0.v3.authentication import ...' with 'from auth0.authentication import ...'.","message":"'from auth0.v3.management import Auth0' and 'from auth0.v3.authentication import ...' raise ModuleNotFoundError on auth0-python >= 4.0. The auth0.v3 namespace was fully removed in v4.","severity":"breaking","affected_versions":">= 4.0"},{"fix":"Use attribute access: user.email. To convert to dict for legacy code: user.model_dump().","message":"v5 Management API responses are Pydantic models, not dicts. user['email'] raises TypeError. user.get('email') returns None silently instead of the value.","severity":"breaking","affected_versions":">= 5.0"},{"fix":"Use ManagementClient with client_id + client_secret (v5) for automatic token caching and refresh. Or re-acquire token on each run.","message":"Management API tokens expire after 24 hours. The v4 Auth0() class does not refresh tokens automatically. Long-running processes silently start returning 401s.","severity":"breaking","affected_versions":"< 5.0"},{"fix":"Iterate directly: 'for user in client.users.list(): ...' — SyncPager handles pagination automatically.","message":"v5 pagination changed. The v4 pattern of manual page= loops with include_totals=True returns a SyncPager in v5, not a dict. result['users'] raises TypeError.","severity":"breaking","affected_versions":">= 5.0"},{"fix":"domain='your-tenant.auth0.com' not domain='https://your-tenant.auth0.com'","message":"Auth0 domain format must be bare domain only: 'your-tenant.auth0.com'. Do NOT prefix with 'https://'. Passing the full URL causes connection errors.","severity":"gotcha","affected_versions":"all"},{"fix":"audience=f'https://{domain}/api/v2/'  # trailing slash required","message":"client_credentials audience must exactly match the API identifier in Auth0 dashboard. For the Management API it is 'https://{domain}/api/v2/' — note the trailing slash. Omitting it returns an invalid token.","severity":"gotcha","affected_versions":"all"},{"fix":"pip install aiohttp alongside auth0-python when using async client.","message":"AsyncManagementClient requires aiohttp which is not auto-installed by auth0-python. ImportError at runtime if missing.","severity":"gotcha","affected_versions":">= 4.0"}],"env_vars":null,"last_verified":"2026-05-12T08:02:37.038Z","next_check":"2026-06-17T00:00:00.000Z","problems":[{"fix":"Update import statements to use the new structure without 'v3', e.g., 'from auth0.authentication import GetToken'.","cause":"The 'auth0.v3' namespace was removed in version 4.0 of the auth0-python library.","error":"ModuleNotFoundError: No module named 'auth0.v3'"},{"fix":"Update import statements to use the new structure without 'v3', e.g., 'from auth0.management import Auth0'.","cause":"The 'auth0.v3' namespace was removed in version 4.0 of the auth0-python library.","error":"ImportError: cannot import name 'Auth0' from 'auth0.v3.management'"},{"fix":"Update import statements to use the new structure without 'v3', e.g., 'from auth0.authentication import GetToken'.","cause":"The 'auth0.v3' namespace was removed in version 4.0 of the auth0-python library.","error":"AttributeError: module 'auth0' has no attribute 'v3'"},{"fix":"Update code to access attributes of the Pydantic models directly, e.g., 'response.attribute_name' instead of 'response['attribute_name']'.","cause":"In version 5.0.0, Management API responses were changed from dictionaries to Pydantic models, affecting how responses are accessed.","error":"TypeError: 'dict' object is not callable"},{"fix":"Access attributes directly using dot notation, e.g., 'user.id' instead of 'user['id']'.","cause":"In version 5.0.0, Management API responses were changed from dictionaries to Pydantic models, making them non-subscriptable.","error":"TypeError: 'User' object is not subscriptable"}],"ecosystem":"pypi","meta_description":null,"install_score":100,"install_tag":"verified","quickstart_score":0,"quickstart_tag":"stale","pypi_latest":null,"install_checks":{"last_tested":"2026-05-12","tag":"verified","tag_description":"installs cleanly on critical runtimes, fast import, recently tested","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.11,"mem_mb":19.9,"disk_size":"89.6M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.82,"mem_mb":19.9,"disk_size":"91M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.49,"mem_mb":21.7,"disk_size":"101.9M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.24,"mem_mb":21.7,"disk_size":"103M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.58,"mem_mb":21.4,"disk_size":"87.5M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.53,"mem_mb":21.4,"disk_size":"89M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.49,"mem_mb":21.9,"disk_size":"86.9M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.48,"mem_mb":21.9,"disk_size":"88M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.06,"mem_mb":19.7,"disk_size":"90.1M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.95,"mem_mb":19.7,"disk_size":"92M"}]},"quickstart_checks":{"last_tested":"2026-05-12","tag":"stale","tag_description":"widespread failures or data too old to trust","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]}}