Auth0 integration library for Python
Project description
pyauth0
Library for Auth0 token validation.
Usage
from pyauth0 import Auth0, Auth0Error
auth0 = Auth0(
auth0_domain="your-tenant-dev.us.pyauth0.com",
api_audience="https://api-dev.your-tenant.com",
jwks_cache_ttl=60, # optional
)
try:
token_payload = auth0.validate_auth_header(
"bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...."
)
except Auth0Error as error:
status_code = error.status_code # suggested status code (401 or 403)
code = error.code # pyauth0 error code (example "invalid_header")
description = error.description # pyauth0 error description (example "Unable to parse authentication token")
raise
claim_value = token_payload.get_claim("http://your-tenant.com/claim_name", "default value")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file pyauth0-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: pyauth0-0.0.3-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 492b326e3c49336014bc620d8639c1e80fc7fc6b33944717e6384250b2955ec6 |
|
MD5 | 956e99d067a48ccee6a3a929f0e889f4 |
|
BLAKE2b-256 | 23ec5f8747ec2fec39d5c14b237166dbdb3008f45f1396f2068f5ec1b6fdaade |