Skip to main content

Azure Active Directory OAuth 2.0 / 2.1 / OIDC 1.0 login implementations for Swarmauri deployments

Project description

Swarmauri Logo

PyPI - Downloads Hits PyPI - Python Version PyPI - License PyPI - swarmauri_auth_idp_azure Discord

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_idp entry 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

  1. Call auth_url() and redirect the browser to the returned Microsoft login URL.
  2. Persist the state token and compare it when handling the callback.
  3. Exchange the authorization code via exchange_and_identity() to obtain tokens and Graph profile data.
  4. Persist the returned tokens or computed identity details for session and authorization workflows.

Entry Points

  • swarmauri.auth_idp:AzureOAuth20Login
  • swarmauri.auth_idp:AzureOAuth21Login
  • swarmauri.auth_idp:AzureOIDC10Login

Contributing

To contribute to swarmauri-sdk, review the guidelines for contributing which cover development workflow, testing, and coding standards.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

swarmauri_auth_idp_azure-0.11.0.dev1.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

swarmauri_auth_idp_azure-0.11.0.dev1-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file swarmauri_auth_idp_azure-0.11.0.dev1.tar.gz.

File metadata

  • Download URL: swarmauri_auth_idp_azure-0.11.0.dev1.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","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

Hashes for swarmauri_auth_idp_azure-0.11.0.dev1.tar.gz
Algorithm Hash digest
SHA256 0aaacc988850354875105af93dfe06afdf44ca9159db5754e236d23a01748148
MD5 f7bc6fcfb42c5a9168dc80fd85d16dd5
BLAKE2b-256 8fa0a27834eafdabb45b59a89ac91c8aabaf03cd4df701e3cbeba6722cf94be9

See more details on using hashes here.

File details

Details for the file swarmauri_auth_idp_azure-0.11.0.dev1-py3-none-any.whl.

File metadata

  • Download URL: swarmauri_auth_idp_azure-0.11.0.dev1-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","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

Hashes for swarmauri_auth_idp_azure-0.11.0.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 efb4b5c65f71da863e648b1687b6f78e52df2dae4b407ac67ed5c01f5e83726c
MD5 1262ddc6994680d350b92e367aea9e7c
BLAKE2b-256 28bafd816248dbf32aa9f331403fd0d5e1f529c29975b0fae03e1ef61ed832a3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page