Azure AD B2C
Simplified Python SDK for verifying AD B2C-issued JWTs
Usage
import aad
token = "..." # JWT to verify
tenant = "..." # B2C tenant (as in `"{tenant}.b2clogin.com/{tenant}..."`)
app_id = "..." # ClientID of app registered in the B2C tenant
policy = "B2C_1_..." # policy (aka user flow) name
await aad.authorize(token, tenant, app_id, policy)
# {
# "idp": "...",
# "aud": "...",
# ... # other JWT fields
# ... # fields configured in B2C
# }
FastAPI dependency
pip install aad[fastapi]
from fastapi import FastAPI
import aad
Claims = aad.claims(tenant, app_id, policy)
app = FastAPI()
@app.get("...")
def get(claims: Claims):
...
Disclaimer
The JWT decoding part is heavily inspired by azure-ad-verify-token, but with an async interface
Metadata
Release files for aad 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aad-0.1.5.tar.gz | 4.2 kB | Without provenance | Details for aad-0.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aad-0.1.5-py3-none-any.whl | Python 3 | none | any | Details for aad-0.1.5-py3-none-any.whl |
Total release size: 9.3 kB
Release files / aad-0.1.5.tar.gz
| Download URL | aad-0.1.5.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5416780f2ac9ccd7972cce8c2c6a5e75e70df7aa0c983f30c8ea50b4bd028a83
|
|
BLAKE2b-256 checksum How to use checksums |
25094bbe3cb1dd5d2527ab47830eb4d3eb9d307209da6ce088a534dfe0a5bf41
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.6
|
Release files / aad-0.1.5-py3-none-any.whl
| Download URL | aad-0.1.5-py3-none-any.whl |
|---|---|
| Size | 5.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7b7d831cb516f8e5c52ad9fe301737425bc1f980b8c12b08bd9bb4bcd6bd6ac6
|
|
BLAKE2b-256 checksum How to use checksums |
ade02495208fe6b9fbd05f178597d8aa29ed1a8fae459e8858679718ccc1b536
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.6
|
Security for aad 0.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.