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.dev2.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.dev2-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.dev2.tar.gz.

File metadata

  • Download URL: swarmauri_auth_idp_aws-0.11.0.dev2.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.dev2.tar.gz
Algorithm Hash digest
SHA256 5905a5e25b2dfa6a48bf58c4535184e02eeab4a0dcff25bd08a7e739893ffc45
MD5 f3767e4a55e1e6e69751745c1a0bd81e
BLAKE2b-256 51fd8cb6272357b724c13bd05989b08628d0a186f20bdda065b2077454053172

See more details on using hashes here.

File details

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

File metadata

  • Download URL: swarmauri_auth_idp_aws-0.11.0.dev2-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.dev2-py3-none-any.whl
Algorithm Hash digest
SHA256 3552ca5ebb579bfd708018dfa3a0df928e0da4d69ab8e7482798ef2acdc63c49
MD5 04f3664d1abcfa8f27315d0ead7eb0b7
BLAKE2b-256 25bb61e58953ba1cf411eeac90c7b9c88135c5e0a49b2138348c243dd0629ab0

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