Skip to main content

No project description provided

Project description

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

Requires Python 3.7 or higher.

Usage

Authentication SDK

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

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

from auth0.authentication import Database

database = Database('my-domain.us.auth0.com', 'my-client-id')

database.signup(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.authentication import GetToken

token = GetToken('my-domain.us.auth0.com', 'my-client-id', client_secret='my-client-secret')

token.login(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.authentication import GetToken

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

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

Then use the token you've obtained as follows:

from auth0.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

  • Database ( authentication.Database )
  • Delegated ( authentication.Delegated )
  • Enterprise ( authentication.Enterprise )
  • API Authorization - Get Token ( authentication.GetToken)
  • BackChannelLogin ( authentication.BackChannelLogin)
  • Passwordless ( authentication.Passwordless )
  • PushedAuthorizationRequests ( authentication.PushedAuthorizationRequests )
  • RevokeToken ( authentication.RevokeToken )
  • Social ( authentication.Social )
  • Users ( authentication.Users )

Management Endpoints

  • Actions() (Auth0().action)
  • AttackProtection() (Auth0().attack_protection)
  • Blacklists() ( Auth0().blacklists )
  • Branding() ( Auth0().branding )
  • ClientCredentials() ( Auth0().client_credentials )
  • 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 )

Support Policy

Our support lifecycle policy mirrors the Python support schedule. We do not support running the SDK on unsupported versions of Python that have ceased to receive security updates. Please ensure your environment remains up to date and running the latest Python version possible.

SDK Version Python Version Support Ends
4.x 3.12 Oct 2028
3.11 Oct 2027
3.10 Oct 2026
3.9 Oct 2025
3.8 Oct 2024

As pip reliably avoids installing package updates that target incompatible Python versions, we may opt to remove support for end-of-life Python versions during minor SDK updates. These are not considered breaking changes by this SDK.

The following is a list of unsupported Python versions, and the last SDK version supporting them:

Python Version Last SDK Version Supporting
>= 3.7 4.6.1
>= 2.0, <= 3.6 3.x

You can determine what version of Python you have installed by running:

python --version

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

auth0_python-4.9.0.tar.gz (75.9 kB view details)

Uploaded Source

Built Distribution

auth0_python-4.9.0-py3-none-any.whl (135.3 kB view details)

Uploaded Python 3

File details

Details for the file auth0_python-4.9.0.tar.gz.

File metadata

  • Download URL: auth0_python-4.9.0.tar.gz
  • Upload date:
  • Size: 75.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for auth0_python-4.9.0.tar.gz
Algorithm Hash digest
SHA256 f9b31ea9c906d0a123b9cdc6ccd7bbbb8156123f44789b08571c45947fb21238
MD5 4fb7f6a24c0be9f9261a608975c3756f
BLAKE2b-256 e8461071f1a190b2397874cb4bf6be4daddc2aa3f83618d27e1e83df89a32c29

See more details on using hashes here.

Provenance

The following attestation bundles were made for auth0_python-4.9.0.tar.gz:

Publisher: publish.yml on auth0/auth0-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file auth0_python-4.9.0-py3-none-any.whl.

File metadata

  • Download URL: auth0_python-4.9.0-py3-none-any.whl
  • Upload date:
  • Size: 135.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for auth0_python-4.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6440c7f74dfd669d9f5cdfe9bb44c4c3b230ce98a82353f55a387e90241fbf5b
MD5 33ea0793b54eaeff9b73ce69f1906592
BLAKE2b-256 acd1800ab8dfe15f00836b8d1ea41f68f5e4731a96e8fc19548993996f3b5728

See more details on using hashes here.

Provenance

The following attestation bundles were made for auth0_python-4.9.0-py3-none-any.whl:

Publisher: publish.yml on auth0/auth0-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page