Azure Active Directory OAuth 2.0 / 2.1 / OIDC 1.0 login implementations for Swarmauri deployments
Project description
Swarmauri Auth IDP Azure AD
Azure Active Directory / Entra ID OAuth 2.0, OAuth 2.1, and OIDC 1.0 login flows packaged for Swarmauri deployments.
Features
- PKCE-enabled authorization URL generation with signed state payloads to protect verifiers.
- Token exchange helpers that return normalized identity details from Microsoft Graph.
- Built-in retrying HTTP client for resilient calls against Azure AD and Graph endpoints.
- ComponentBase-compatible models that register under
swarmauri.auth_idpentry points. - Support for both interactive browser logins and confidential client OIDC workflows.
Installation
pip
pip install swarmauri_auth_idp_azure
uv (project)
uv add swarmauri_auth_idp_azure
uv (environment)
uv pip install swarmauri_auth_idp_azure
Usage
from pydantic import SecretStr
from swarmauri_auth_idp_azure import AzureOAuth21Login
login = AzureOAuth21Login(
tenant="organizations",
client_id="00000000-0000-0000-0000-000000000000",
client_secret=SecretStr("client-secret"),
redirect_uri="https://app.example.com/auth/callback",
state_secret=b"azure-ad-state-key",
)
print(login.client_id)
Workflow Summary
- Call
auth_url()and redirect the browser to the returned Microsoft login URL. - Persist the
statetoken and compare it when handling the callback. - Exchange the authorization code via
exchange_and_identity()to obtain tokens and Graph profile data. - Persist the returned tokens or computed identity details for session and authorization workflows.
Entry Points
swarmauri.auth_idp:AzureOAuth20Loginswarmauri.auth_idp:AzureOAuth21Loginswarmauri.auth_idp:AzureOIDC10Login
Contributing
To contribute to swarmauri-sdk, review the guidelines for contributing which cover development workflow, testing, and coding standards.
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 Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file swarmauri_auth_idp_azure-0.2.0.dev5.tar.gz.
File metadata
- Download URL: swarmauri_auth_idp_azure-0.2.0.dev5.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05916095b24475aca933a68fa2d9bfcc1f7955d214f9508cf3727476a40e33c3
|
|
| MD5 |
630f2b03ce7b31f8fd3192236a8c9ee4
|
|
| BLAKE2b-256 |
c88d697f1c299bc8d445a85ef1a827ece00020ff4a0c0d0dfcdfb61c26704120
|
File details
Details for the file swarmauri_auth_idp_azure-0.2.0.dev5-py3-none-any.whl.
File metadata
- Download URL: swarmauri_auth_idp_azure-0.2.0.dev5-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
497932f1ad5763f6596725a3d3289e933d42f894097c0eaf77ffcb5d00e3a6f8
|
|
| MD5 |
7bc16166919e5f6d8fe37ddad83a93d8
|
|
| BLAKE2b-256 |
f0d56027bc35db8176e0a001c53facd14686c622390e132e3c41418a2424a1a3
|