Catalog PyPI
PACKAGE EXPLORERView in registry

aad

PyPI

Async Python SDK for validating Azure AD B2C access tokens

Versions collected1
Direct dependencies4From release 0.1.5
Last observed20 Oct, 16:51 UTC

README

Version 0.1.5 documentation

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

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.517 Mar 20244

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
moveread/azure-sdks

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 16:51 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:07874f99703ef2cb33809f0c31ac1549b5b9b1bbd18ea4390609f4f1397c6497