Google OAuth 2.0 / OAuth 2.1 / OIDC 1.0 identity provider implementations for Swarmauri
Project description
Swarmauri Auth IDP Google
Google OAuth 2.0 / OAuth 2.1 / OIDC 1.0 identity providers packaged for Swarmauri deployments.
Features
- PKCE-enabled Authorization Code flows with HMAC-signed state payloads.
- Discovery-driven OAuth 2.1/OIDC login that validates ID tokens and nonces.
- Profile hydration via Google UserInfo endpoints for normalized downstream payloads.
- Retry-aware HTTP integration tuned for Google Identity services.
- ComponentBase-compatible models registered under
swarmauri.auth_idpentry points.
Installation
pip
pip install swarmauri_auth_idp_google
uv (project)
uv add swarmauri_auth_idp_google
uv (environment)
uv pip install swarmauri_auth_idp_google
Usage
import asyncio
from pydantic import SecretBytes, SecretStr
from swarmauri_auth_idp_google import GoogleOAuth20Login
login = GoogleOAuth20Login(
client_id="google-client-id",
client_secret=SecretStr("google-client-secret"),
redirect_uri="https://app.example.com/callback",
state_secret=SecretBytes(b"replace-with-random-bytes"),
)
async def run_flow() -> None:
auth = await login.auth_url()
print(auth["url"])
# Redirect the browser to `auth["url"]`, then capture the callback `code` and `state`.
# Later, call `login.exchange_and_identity(code, state)` inside your callback handler.
asyncio.run(run_flow())
Workflow Summary
- Call
auth_url()and redirect the browser to the returned URL. - Persist the
stateand verify it during the callback handler. - Exchange the authorization code through
exchange_and_identity()to obtain tokens and profile metadata.
Entry Points
swarmauri.auth_idp:GoogleOAuth20Loginswarmauri.auth_idp:GoogleOAuth21Loginswarmauri.auth_idp:GoogleOIDC10Login
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_google-0.2.0.dev5.tar.gz.
File metadata
- Download URL: swarmauri_auth_idp_google-0.2.0.dev5.tar.gz
- Upload date:
- Size: 9.1 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 |
be1f34884fa6a3ef48f6a4698ceb898d9a0c0e79c755f82bbbd78eb06364d8a6
|
|
| MD5 |
0d82f54721d914905722a3daba17a643
|
|
| BLAKE2b-256 |
4e17ad69f8d2e8014292acfeab83a23d83d33b07ca75ffd0fbfed61bec2675ca
|
File details
Details for the file swarmauri_auth_idp_google-0.2.0.dev5-py3-none-any.whl.
File metadata
- Download URL: swarmauri_auth_idp_google-0.2.0.dev5-py3-none-any.whl
- Upload date:
- Size: 12.8 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 |
475ca1a0d6652e4cd0870ca99cc18b56c704bcd6598cb052cda6c3640ecb08d0
|
|
| MD5 |
ecb9c05240f1a5fdff342ef048af5b9a
|
|
| BLAKE2b-256 |
5dbafe024741ae49d94fc3c02cdf743c5971f29262d6f1def2c8d8d003cb0184
|