Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Auth0 SDK for Python

License

NotificationsYou must be signed in to change notification settings

auth0/auth0-python

Repository files navigation

Auth0 SDK for Python

ReleaseCodecovAsk DeepWikiDownloadsLicenseCircleCI

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 theAPI documentation.

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

fromauth0.authenticationimportDatabasedatabase=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 theGetToken object, which enables making requests to the/oauth/token endpoint.

fromauth0.authenticationimportGetTokentoken=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 aManagement 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 anon interactive client authorized to access the API. For example:

fromauth0.authenticationimportGetTokendomain='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:

fromauth0.managementimportAuth0domain='myaccount.auth0.com'mgmt_api_token='MGMT_API_TOKEN'auth0=Auth0(domain,mgmt_api_token)

TheAuth0() object is now ready to take orders, see ourconnections 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 ourexamples.

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 )
  • NetworkAcls() (Auth0().network_acls )
  • Organizations() (Auth0().organizations )
  • Prompts() (Auth0().prompts )
  • ResourceServers() (Auth0().resource_servers )
  • Roles() (Auth0().roles )
  • RulesConfigs() (Auth0().rules_configs )
  • Rules() (Auth0().rules )
  • SelfServiceProfiles() (Auth0().self_service_profiles )
  • 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 thePython 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 VersionPython VersionSupport Ends
4.x3.12Oct 2028
3.11Oct 2027
3.10Oct 2026
3.9Oct 2025
3.8Oct 2024

Aspipreliably avoids installing package updates that target incompatible Python versions, we may opt to remove support forend-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 VersionLast SDK Version Supporting
>= 3.74.6.1
>= 2.0, <= 3.63.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, pleaseraise an issue on our issue tracker.

Vulnerability Reporting

Please do not report security vulnerabilities on the public GitHub issue tracker. TheResponsible 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 checkoutWhy Auth0?

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

About

Auth0 SDK for Python

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Contributors99

Languages


[8]ページ先頭

©2009-2025 Movatter.jp