Pre-release
This release is a pre-release and may not be stable for production use.
Swarmauri Auth IDP Okta
Okta OAuth 2.0 / OAuth 2.1 / OIDC 1.0 identity providers packaged for Swarmauri deployments.
Features
- PKCE-enabled Authorization Code flows that integrate with Okta authorization servers.
- Machine-to-machine app clients for Okta OAuth 2.0, OAuth 2.1 (private key JWT), and OIDC 1.0.
- Discovery-driven OAuth 2.1/OIDC login that verifies ID tokens using Okta JWKS.
- UserInfo enrichment for deployments that require full user profile hydration.
- Retry-aware HTTP integration tuned for Okta endpoints.
- ComponentBase-compatible models registered under
swarmauri.auth_idpentry points.
Installation
pip
pip install swarmauri_auth_idp_okta
uv (project)
uv add swarmauri_auth_idp_okta
uv (environment)
uv pip install swarmauri_auth_idp_okta
Usage
import asyncio
from pydantic import SecretBytes, SecretStr
from swarmauri_auth_idp_okta import OktaOAuth20Login
login = OktaOAuth20Login(
issuer="https://example.okta.com/oauth2/default",
client_id="okta-client-id",
client_secret=SecretStr("okta-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.
Server-to-server client credentials
import asyncio
from pydantic import SecretStr
from swarmauri_auth_idp_okta import OktaOAuth20AppClient
client = OktaOAuth20AppClient(
issuer="https://example.okta.com/oauth2/default",
client_id="machine-client-id",
client_secret=SecretStr("machine-client-secret"),
)
async def fetch_token() -> None:
token = await client.access_token(scope="customScope")
print(token)
asyncio.run(fetch_token())
Use OktaOAuth21AppClient when the integration should authenticate with
private_key_jwt, or OktaOIDC10AppClient to rely on discovery metadata for
tenant-specific token endpoints.
Entry Points
swarmauri.auth_idp:OktaOAuth20AppClientswarmauri.auth_idp:OktaOAuth20Loginswarmauri.auth_idp:OktaOAuth21AppClientswarmauri.auth_idp:OktaOAuth21Loginswarmauri.auth_idp:OktaOIDC10AppClientswarmauri.auth_idp:OktaOIDC10Login
Contributing
To contribute to swarmauri-sdk, review the guidelines for contributing which cover development workflow, testing, and coding standards.
Metadata
Release files for swarmauri_auth_idp_okta 0.11.0.dev2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| swarmauri_auth_idp_okta-0.11.0.dev2.tar.gz | 11.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| swarmauri_auth_idp_okta-0.11.0.dev2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.2 kB
Release files / swarmauri_auth_idp_okta-0.11.0.dev2.tar.gz
| Download URL | swarmauri_auth_idp_okta-0.11.0.dev2.tar.gz |
|---|---|
| Size | 11.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b48af6538f1c9765a3fb867a89cf18d687613f0133530eb0076309c3d1f74e02
|
|
BLAKE2b-256 checksum How to use checksums |
5b47f6873e5b47c5e7cceef75888ebab1f2633082bb4df53ddecdcb5c8a3781c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|
Release files / swarmauri_auth_idp_okta-0.11.0.dev2-py3-none-any.whl
| Download URL | swarmauri_auth_idp_okta-0.11.0.dev2-py3-none-any.whl |
|---|---|
| Size | 16.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b17353d7bdc55744f92020c96a4a6cae38d991afa3dfd4d3e9e2fb32553676e7
|
|
BLAKE2b-256 checksum How to use checksums |
3f2497f4eb0372dc22e88e9dcbf80983fc8132b2d80d6a0a2b612f14502794ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|