auth0-python


Nameauth0-python JSON
Version 4.7.2 PyPI version JSON
download
home_pagehttps://auth0.com
SummaryNone
upload_time2024-09-11 06:23:38
maintainerNone
docs_urlNone
authorAuth0
requires_python>=3.8
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![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)
![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)

<div>
📚 <a href="#documentation">Documentation</a> - 🚀 <a href="#getting-started">Getting started</a> - 💻 <a href="#api-reference">API reference</a> - 💬 <a href="#feedback">Feedback</a>
</div>


Learn how to integrate Auth0 with Python.
## Documentation
- [Docs site](https://www.auth0.com/docs) - 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](https://auth0.com/docs/auth-api).

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

```python
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.

```python
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](https://auth0.com/docs/api/management/v2/tokens). 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](https://auth0.com/docs/api/management/v2/tokens#1-create-and-authorize-a-client) authorized to access the API. For example:

```python
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:

```python
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](https://github.com/auth0/auth0-python/blob/master/EXAMPLES.md#connections) 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](https://github.com/auth0/auth0-python/blob/master/EXAMPLES.md).

## API reference

### Authentication Endpoints

- 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` )
- 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](https://devguide.python.org/versions/). 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](https://packaging.python.org/en/latest/tutorials/packaging-projects/#configuring-metadata) installing package updates that target incompatible Python versions, we may opt to remove support for [end-of-life](https://en.wikipedia.org/wiki/CPython#Version_history) 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:

- [Auth0's general contribution guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md)
- [Auth0's code of conduct guidelines](https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md)

### Raise an issue

To provide feedback or report a bug, please [raise an issue on our issue tracker](https://github.com/auth0/auth0-python/issues).

### Vulnerability Reporting

Please do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://auth0.com/responsible-disclosure-policy) details the procedure for disclosing security issues.

---

<p align="center">
  <picture>
    <source media="(prefers-color-scheme: light)" srcset="https://cdn.auth0.com/website/sdks/logos/auth0_light_mode.png"   width="150">
    <source media="(prefers-color-scheme: dark)" srcset="https://cdn.auth0.com/website/sdks/logos/auth0_dark_mode.png" width="150">
    <img alt="Auth0 Logo" src="https://cdn.auth0.com/website/sdks/logos/auth0_light_mode.png" width="150">
  </picture>
</p>
<p align="center">Auth0 is an easy to implement, adaptable authentication and authorization platform. To learn more checkout <a href="https://auth0.com/why-auth0">Why Auth0?</a></p>
<p align="center">
This project is licensed under the MIT license. See the <a href="https://github.com/auth0/auth0-python/blob/master/LICENSE"> LICENSE</a> file for more info.</p>


            

Raw data

            {
    "_id": null,
    "home_page": "https://auth0.com",
    "name": "auth0-python",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": "Auth0",
    "author_email": "support@auth0.com",
    "download_url": "https://files.pythonhosted.org/packages/12/81/3e867262f1f48fdacb1f8e9853497f6283274ba2c3c145e767bc0c7ed3c8/auth0_python-4.7.2.tar.gz",
    "platform": null,
    "description": "![Auth0 SDK for Python](https://cdn.auth0.com/website/sdks/banners/auth0-python-banner.png)\n\n![Release](https://img.shields.io/pypi/v/auth0-python)\n[![Codecov](https://img.shields.io/codecov/c/github/auth0/auth0-python)](https://codecov.io/gh/auth0/auth0-python)\n![Downloads](https://img.shields.io/pypi/dw/auth0-python)\n[![License](https://img.shields.io/:license-MIT-blue.svg?style=flat)](https://opensource.org/licenses/MIT)\n[![CircleCI](https://img.shields.io/circleci/build/github/auth0/auth0-python)](https://circleci.com/gh/auth0/auth0-python)\n\n<div>\n\ud83d\udcda <a href=\"#documentation\">Documentation</a> - \ud83d\ude80 <a href=\"#getting-started\">Getting started</a> - \ud83d\udcbb <a href=\"#api-reference\">API reference</a> - \ud83d\udcac <a href=\"#feedback\">Feedback</a>\n</div>\n\n\nLearn how to integrate Auth0 with Python.\n## Documentation\n- [Docs site](https://www.auth0.com/docs) - explore our docs site and learn more about Auth0.\n\n## Getting started\n### Installation\nYou can install the auth0 Python SDK using the following command.\n```\npip install auth0-python\n```\n\n> Requires Python 3.7 or higher.\n\n### Usage\n\n#### Authentication SDK\nThe Authentication SDK is organized into components that mirror the structure of the\n[API documentation](https://auth0.com/docs/auth-api).\n\nIf you need to sign up a user using their email and password, you can use the Database object.\n\n```python\nfrom auth0.authentication import Database\n\ndatabase = Database('my-domain.us.auth0.com', 'my-client-id')\n\ndatabase.signup(email='user@domain.com', password='secr3t', connection='Username-Password-Authentication')\n```\n\nIf 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.\n\n```python\nfrom auth0.authentication import GetToken\n\ntoken = GetToken('my-domain.us.auth0.com', 'my-client-id', client_secret='my-client-secret')\n\ntoken.login(username='user@domain.com', password='secr3t', realm='Username-Password-Authentication')\n```\n\n#### Management SDK\nTo use the management library you will need to instantiate an Auth0 object with a domain and a [Management API v2 token](https://auth0.com/docs/api/management/v2/tokens). 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](https://auth0.com/docs/api/management/v2/tokens#1-create-and-authorize-a-client) authorized to access the API. For example:\n\n```python\nfrom auth0.authentication import GetToken\n\ndomain = 'myaccount.auth0.com'\nnon_interactive_client_id = 'exampleid'\nnon_interactive_client_secret = 'examplesecret'\n\nget_token = GetToken(domain, non_interactive_client_id, client_secret=non_interactive_client_secret)\ntoken = get_token.client_credentials('https://{}/api/v2/'.format(domain))\nmgmt_api_token = token['access_token']\n```\n\nThen use the token you've obtained as follows:\n\n```python\nfrom auth0.management import Auth0\n\ndomain = 'myaccount.auth0.com'\nmgmt_api_token = 'MGMT_API_TOKEN'\n\nauth0 = Auth0(domain, mgmt_api_token)\n```\n\nThe `Auth0()` object is now ready to take orders, see our [connections example](https://github.com/auth0/auth0-python/blob/master/EXAMPLES.md#connections) to find out how to use it!\n\nFor more code samples on how to integrate the auth0-python SDK in your Python application, have a look at our [examples](https://github.com/auth0/auth0-python/blob/master/EXAMPLES.md).\n\n## API reference\n\n### Authentication Endpoints\n\n- Database ( `authentication.Database` )\n- Delegated ( `authentication.Delegated` )\n- Enterprise ( `authentication.Enterprise` )\n- API Authorization - Get Token ( `authentication.GetToken`)\n- Passwordless ( `authentication.Passwordless` )\n- RevokeToken ( `authentication.RevokeToken` )\n- Social ( `authentication.Social` )\n- Users ( `authentication.Users` )\n\n\n### Management Endpoints\n\n- Actions() (`Auth0().action`)\n- AttackProtection() (`Auth0().attack_protection`)\n- Blacklists() ( `Auth0().blacklists` )\n- Branding() ( `Auth0().branding` )\n- ClientCredentials() ( `Auth0().client_credentials` )\n- ClientGrants() ( `Auth0().client_grants` )\n- Clients() ( `Auth0().clients` )\n- Connections() ( `Auth0().connections` )\n- CustomDomains() ( `Auth0().custom_domains` )\n- DeviceCredentials() ( `Auth0().device_credentials` )\n- EmailTemplates() ( `Auth0().email_templates` )\n- Emails() ( `Auth0().emails` )\n- Grants() ( `Auth0().grants` )\n- Guardian() ( `Auth0().guardian` )\n- Hooks() ( `Auth0().hooks` )\n- Jobs() ( `Auth0().jobs` )\n- LogStreams() ( `Auth0().log_streams` )\n- Logs() ( `Auth0().logs` )\n- Organizations() ( `Auth0().organizations` )\n- Prompts() ( `Auth0().prompts` )\n- ResourceServers() (`Auth0().resource_servers` )\n- Roles() ( `Auth0().roles` )\n- RulesConfigs() ( `Auth0().rules_configs` )\n- Rules() ( `Auth0().rules` )\n- Stats() ( `Auth0().stats` )\n- Tenants() ( `Auth0().tenants` )\n- Tickets() ( `Auth0().tickets` )\n- UserBlocks() (`Auth0().user_blocks` )\n- UsersByEmail() ( `Auth0().users_by_email` )\n- Users() ( `Auth0().users` )\n\n## Support Policy\n\nOur support lifecycle policy mirrors the [Python support schedule](https://devguide.python.org/versions/). 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.\n\n| SDK Version | Python Version | Support Ends |\n|-------------|----------------|--------------|\n| 4.x         | 3.12           | Oct 2028     |\n|             | 3.11           | Oct 2027     |\n|             | 3.10           | Oct 2026     |\n|             | 3.9            | Oct 2025     |\n|             | 3.8            | Oct 2024     |\n\n> As `pip` [reliably avoids](https://packaging.python.org/en/latest/tutorials/packaging-projects/#configuring-metadata) installing package updates that target incompatible Python versions, we may opt to remove support for [end-of-life](https://en.wikipedia.org/wiki/CPython#Version_history) Python versions during minor SDK updates. These are not considered breaking changes by this SDK.\n\nThe following is a list of unsupported Python versions, and the last SDK version supporting them:\n\n| Python Version | Last SDK Version Supporting |\n|----------------|-----------------------------|\n| <= 3.7         | 4.6.1                       |\n| >= 2.0, <= 3.6 | 3.x                         |\n\nYou can determine what version of Python you have installed by running:\n\n```\npython --version\n```\n\n## Feedback\n\n### Contributing\n\nWe appreciate feedback and contribution to this repo! Before you get started, please see the following:\n\n- [Auth0's general contribution guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md)\n- [Auth0's code of conduct guidelines](https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md)\n\n### Raise an issue\n\nTo provide feedback or report a bug, please [raise an issue on our issue tracker](https://github.com/auth0/auth0-python/issues).\n\n### Vulnerability Reporting\n\nPlease do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://auth0.com/responsible-disclosure-policy) details the procedure for disclosing security issues.\n\n---\n\n<p align=\"center\">\n  <picture>\n    <source media=\"(prefers-color-scheme: light)\" srcset=\"https://cdn.auth0.com/website/sdks/logos/auth0_light_mode.png\"   width=\"150\">\n    <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://cdn.auth0.com/website/sdks/logos/auth0_dark_mode.png\" width=\"150\">\n    <img alt=\"Auth0 Logo\" src=\"https://cdn.auth0.com/website/sdks/logos/auth0_light_mode.png\" width=\"150\">\n  </picture>\n</p>\n<p align=\"center\">Auth0 is an easy to implement, adaptable authentication and authorization platform. To learn more checkout <a href=\"https://auth0.com/why-auth0\">Why Auth0?</a></p>\n<p align=\"center\">\nThis project is licensed under the MIT license. See the <a href=\"https://github.com/auth0/auth0-python/blob/master/LICENSE\"> LICENSE</a> file for more info.</p>\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": null,
    "version": "4.7.2",
    "project_urls": {
        "Homepage": "https://auth0.com",
        "Repository": "https://github.com/auth0/auth0-python"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e40e38cb7b781371e79e9c697fb78f3ccd18fda8bd547d0a2e76e616561a3792",
                "md5": "ef0ad2ae5ac841523d14342eb0c5694b",
                "sha256": "df2224f9b1e170b3aa12d8bc7ff02eadb7cc229307a09ec6b8a55fd1e0e05dc8"
            },
            "downloads": -1,
            "filename": "auth0_python-4.7.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ef0ad2ae5ac841523d14342eb0c5694b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 131834,
            "upload_time": "2024-09-11T06:23:36",
            "upload_time_iso_8601": "2024-09-11T06:23:36.619450Z",
            "url": "https://files.pythonhosted.org/packages/e4/0e/38cb7b781371e79e9c697fb78f3ccd18fda8bd547d0a2e76e616561a3792/auth0_python-4.7.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "12813e867262f1f48fdacb1f8e9853497f6283274ba2c3c145e767bc0c7ed3c8",
                "md5": "e5e5c36e857540ed7eb56aa14eee9846",
                "sha256": "5d36b7f26defa946c0a548dddccf0451fc62e9f8e61fd0138c5025ad2506ba8b"
            },
            "downloads": -1,
            "filename": "auth0_python-4.7.2.tar.gz",
            "has_sig": false,
            "md5_digest": "e5e5c36e857540ed7eb56aa14eee9846",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 73261,
            "upload_time": "2024-09-11T06:23:38",
            "upload_time_iso_8601": "2024-09-11T06:23:38.030568Z",
            "url": "https://files.pythonhosted.org/packages/12/81/3e867262f1f48fdacb1f8e9853497f6283274ba2c3c145e767bc0c7ed3c8/auth0_python-4.7.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-11 06:23:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "auth0",
    "github_project": "auth0-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "auth0-python"
}
        
Elapsed time: 0.37769s