Skip to main content

AWS IAM Identity Center OAuth 2.0 / 2.1 login implementations for Swarmauri

Project description

Swarmauri Logo

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

Swarmauri Auth IDP AWS

AWS IAM Identity Center OAuth 2.0 / 2.1 logins packaged for Swarmauri deployments.

Features

  • PKCE-enabled authorization URL generation with signed state payloads.
  • Token exchange helpers that return normalized payloads for downstream services.
  • Optional identity resolver that hydrates user details via AWS Identity Store.
  • ComponentBase-compatible models that register under swarmauri.auth_idp entry points.
  • Retry-aware HTTP client tuned for AWS IAM Identity Center endpoints.

Installation

pip

pip install swarmauri_auth_idp_aws

uv (project)

uv add swarmauri_auth_idp_aws

uv (environment)

uv pip install swarmauri_auth_idp_aws

Usage

import asyncio
from swarmauri_auth_idp_aws import AwsOAuth21Login
from pydantic import SecretStr

login = AwsOAuth21Login(
    authorization_endpoint="https://example.awsapps.com/start/oauth2/authorize",
    token_endpoint="https://example.awsapps.com/start/oauth2/token",
    client_id="client-id",
    client_secret=SecretStr("client-secret"),
    redirect_uri="https://app.example.com/callback",
    state_secret=b"aws-workforce-state-key",
)

async def flow() -> None:
    auth = await login.auth_url()
    # Redirect the user to auth["url"], then capture the returned code/state.
    print(auth["url"])

asyncio.run(flow())

Workflow Summary

  1. Call auth_url() and redirect the browser to the returned URL.
  2. Persist the state and compare it when handling the callback.
  3. Exchange the authorization code via exchange_and_identity() to obtain tokens.
  4. Optionally use AwsIdentityResolver to enrich identity details for the session.

Entry Points

  • swarmauri.auth_idp:AwsOAuth20Login
  • swarmauri.auth_idp:AwsOAuth21Login

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_aws-0.11.0.dev1.tar.gz (8.5 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_aws-0.11.0.dev1-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: swarmauri_auth_idp_aws-0.11.0.dev1.tar.gz
  • Upload date:
  • Size: 8.5 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_aws-0.11.0.dev1.tar.gz
Algorithm Hash digest
SHA256 31942d2e7406d37a46e257bf8a77a8c975ebed7a40b2261ea7e7cdd57e8a798f
MD5 1df0f08e9e4083c9cce68c0090f0261d
BLAKE2b-256 226d12e2184e61182bfcaceb2e69b1f25a214203fbb216568a7ba75ca6f2ea43

See more details on using hashes here.

File details

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

File metadata

  • Download URL: swarmauri_auth_idp_aws-0.11.0.dev1-py3-none-any.whl
  • Upload date:
  • Size: 10.9 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_aws-0.11.0.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 8d4d9d4cb63da93928a9754fc5c91b65c36f7fff34ae9792e3e4f59cca40b88c
MD5 62c5383f65f692b262753cfa7d68d31e
BLAKE2b-256 b63d40486650feb30fa730099c23d599b3a412a498cb6c86668b8971658ae2f0

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