AWS IAM Identity Center OAuth 2.0 / 2.1 login implementations for Swarmauri
Project description
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_idpentry 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
- Call
auth_url()and redirect the browser to the returned URL. - Persist the
stateand compare it when handling the callback. - Exchange the authorization code via
exchange_and_identity()to obtain tokens. - Optionally use
AwsIdentityResolverto enrich identity details for the session.
Entry Points
swarmauri.auth_idp:AwsOAuth20Loginswarmauri.auth_idp:AwsOAuth21Login
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_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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5905a5e25b2dfa6a48bf58c4535184e02eeab4a0dcff25bd08a7e739893ffc45
|
|
| MD5 |
f3767e4a55e1e6e69751745c1a0bd81e
|
|
| BLAKE2b-256 |
51fd8cb6272357b724c13bd05989b08628d0a186f20bdda065b2077454053172
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3552ca5ebb579bfd708018dfa3a0df928e0da4d69ab8e7482798ef2acdc63c49
|
|
| MD5 |
04f3664d1abcfa8f27315d0ead7eb0b7
|
|
| BLAKE2b-256 |
25bb61e58953ba1cf411eeac90c7b9c88135c5e0a49b2138348c243dd0629ab0
|