Skip to main content

Auth0 SDK for Python

Release Codecov Downloads License CircleCI

Learn how to integrate Auth0 with Python.

Documentation

  • Docs site - explore our docs site and learn more about Auth0.

Getting started

Installation

You can install the auth0 Python SDK using the following command.

pip install auth0-python

For python3, use the following command

pip3 install auth0-python

Python 3.2 and 3.3 have reached EOL and support will be removed in the near future.

Usage

Authentication SDK

The Authentication SDK is organized into components that mirror the structure of the API documentation. For example:

from auth0.v3.authentication import Social

social = Social('myaccount.auth0.com')

social.login(client_id='...', access_token='...', connection='facebook')

If you need to sign up a user using their email and password, you can use the Database object.

from auth0.v3.authentication import Database

database = Database('myaccount.auth0.com'')

database.signup(client_id='...', email='user@domain.com', password='secr3t', connection='Username-Password-Authentication')

If you need to authenticate a user using their email and password, you can use the GetToken object, which enables making requests to the /oauth/token endpoint.

from auth0.v3.authentication import GetToken

token = GetToken('myaccount.auth0.com')

token.login(client_id='...', client_secret='...', username='user@domain.com', password='secr3t', realm='Username-Password-Authentication')

Management SDK

To use the management library you will need to instantiate an Auth0 object with a domain and a Management API v2 token. Please note that these token last 24 hours, so if you need it constantly you should ask for it programmatically using the client credentials grant with a non interactive client authorized to access the API. For example:

from auth0.v3.authentication import GetToken

domain = 'myaccount.auth0.com'
non_interactive_client_id = 'exampleid'
non_interactive_client_secret = 'examplesecret'

get_token = GetToken(domain)
token = get_token.client_credentials(non_interactive_client_id,
    non_interactive_client_secret, 'https://{}/api/v2/'.format(domain))
mgmt_api_token = token['access_token']

Then use the token you've obtained as follows:

from auth0.v3.management import Auth0

domain = 'myaccount.auth0.com'
mgmt_api_token = 'MGMT_API_TOKEN'

auth0 = Auth0(domain, mgmt_api_token)

The Auth0() object is now ready to take orders, see our connections example to find out how to use it!

For more code samples on how to integrate the auth0-python SDK in your Python application, have a look at our examples.

API reference

Authentication Endpoints

  • API Authorization - Authorization Code Grant (authentication.AuthorizeClient)
  • Database ( authentication.Database )
  • Delegated ( authentication.Delegated )
  • Enterprise ( authentication.Enterprise )
  • API Authorization - Get Token ( authentication.GetToken)
  • Passwordless ( authentication.Passwordless )
  • RevokeToken ( authentication.RevokeToken )
  • Social ( authentication.Social )
  • Users ( authentication.Users )

Management Endpoints

  • Actions() (Auth0().action)
  • AttackProtection() (Auth0().attack_protection)
  • Blacklists() ( Auth0().blacklists )
  • Branding() ( Auth0().branding )
  • ClientGrants() ( Auth0().client_grants )
  • Clients() ( Auth0().clients )
  • Connections() ( Auth0().connections )
  • CustomDomains() ( Auth0().custom_domains )
  • DeviceCredentials() ( Auth0().device_credentials )
  • EmailTemplates() ( Auth0().email_templates )
  • Emails() ( Auth0().emails )
  • Grants() ( Auth0().grants )
  • Guardian() ( Auth0().guardian )
  • Hooks() ( Auth0().hooks )
  • Jobs() ( Auth0().jobs )
  • LogStreams() ( Auth0().log_streams )
  • Logs() ( Auth0().logs )
  • Organizations() ( Auth0().organizations )
  • Prompts() ( Auth0().prompts )
  • ResourceServers() (Auth0().resource_servers )
  • Roles() ( Auth0().roles )
  • RulesConfigs() ( Auth0().rules_configs )
  • Rules() ( Auth0().rules )
  • Stats() ( Auth0().stats )
  • Tenants() ( Auth0().tenants )
  • Tickets() ( Auth0().tickets )
  • UserBlocks() (Auth0().user_blocks )
  • UsersByEmail() ( Auth0().users_by_email )
  • Users() ( Auth0().users )

Feedback

Contributing

We appreciate feedback and contribution to this repo! Before you get started, please see the following:

Raise an issue

To provide feedback or report a bug, please raise an issue on our issue tracker.

Vulnerability Reporting

Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.


Auth0 Logo

Auth0 is an easy to implement, adaptable authentication and authorization platform. To learn more checkout Why Auth0?

This project is licensed under the MIT license. See the LICENSE file for more info.

Release files for auth0-python 3.24.1

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

Source distribution (sdist)

Source distribution for auth0-python 3.24.1
File Size Uploaded
auth0-python-3.24.1.tar.gz 69.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for auth0-python 3.24.1
File Interpreter ABI Platform
auth0_python-3.24.1-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 191.8 kB

Release files / auth0-python-3.24.1.tar.gz

Download URL auth0-python-3.24.1.tar.gz
Size 69.2 kB
Tags Source
SHA-256 checksum
How to use checksums
62c2e177b9517879bd8632da9eb7668aedd5775fddea87b0e0e1e9a89b9dd096
BLAKE2b-256 checksum
How to use checksums
79063334c49f2fe98e6e19f31689fa3654372910c865428b2239720f4253ae60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.4

Release files / auth0_python-3.24.1-py2.py3-none-any.whl

Download URL auth0_python-3.24.1-py2.py3-none-any.whl
Size 122.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
87dbf603c89fcebfd35f5ba29bc8a820af72a7d5a772f53752ae04d30f191712
BLAKE2b-256 checksum
How to use checksums
efd287581b9a278c2da70c7fa80d110f236c14aa004820fe55ce3d3896b7b70a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.4

Release history Release notifications | RSS feed

6.6.0

2 release files

6.5.0

2 release files

6.4.0

2 release files

6.3.0

2 release files

6.2.0

2 release files

6.1.0

2 release files

6.0.0

2 release files

5.8.0

2 release files

5.7.0

2 release files

5.6.0

2 release files

5.5.0

2 release files

5.4.0

2 release files

5.3.0

2 release files

5.2.0

2 release files

5.1.0

2 release files

5.0.0

2 release files

4.13.0

2 release files

4.12.0

2 release files

4.11.0

2 release files

4.10.0

2 release files

4.9.0

2 release files

4.8.1

2 release files

4.8.0

2 release files

4.7.2

2 release files

4.7.1

2 release files

4.7.0

2 release files

4.6.1

2 release files

4.6.0

2 release files

4.5.0

2 release files

4.4.2

2 release files

4.4.1

2 release files

4.4.0

2 release files

4.3.0

2 release files

4.2.0

2 release files

4.1.1

2 release files

4.1.0

2 release files

4.0.0

2 release files

This release

3.24.1 This release

2 release files

3.24.0

2 release files

3.23.1

2 release files

3.22.0

2 release files

3.20.0

2 release files

3.19.0

2 release files

3.18.0

2 release files

3.17.0

2 release files

3.16.2

2 release files

3.16.1

2 release files

3.15.0

2 release files

3.14.0

2 release files

3.13.0

2 release files

3.12.0

2 release files

3.11.0

2 release files

3.10.0

2 release files

3.9.2

2 release files

3.9.1

2 release files

3.9.0

2 release files

3.8.1

2 release files

3.8.0

2 release files

3.7.2

2 release files

3.7.1

2 release files

3.7.0

2 release files

3.6.1

2 release files

3.6.0

2 release files

3.5.0

2 release files

3.4.0

2 release files

3.3.0

2 release files

3.2.2

2 release files

3.2.0

3 release files

3.1.4

2 release files

3.1.3

2 release files

3.1.2

2 release files

3.1.1

2 release files

3.1.0

2 release files

3.0.0

2 release files

2.0.1

2 release files

2.0.0

2 release files

2.0.0b1

0.0.0

2 release files

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