OIDC bearer authentication provider plugin for Spakky framework
Project description
spakky-oidc
spakky-oidc authenticates OIDC/OAuth bearer JWT credentials and maps
validated claims into spakky.auth.AuthContext.
The provider contributes AuthCapability.AUTHENTICATION through the
spakky.contributions.spakky.auth entry point. It intentionally contains no
browser login, callback, session, refresh, or logout routes; inbound adapters
pass an already-observed bearer credential to the provider-neutral
IAuthenticationProvider port.
Capabilities
- OIDC discovery from
issuer/.well-known/openid-configurationor an explicit discovery URL. - JWKS key selection by
kidand RS256 signature verification. issuer,audience,azp,exp,nbf,iat, and clock skew validation.sub, display name, tenant, role, scope, and selected safe claim mapping toAuthContext.- Raw bearer token exclusion from
AuthContext.claims,metadata, andcredential_carrier.
Installation
pip install spakky-oidc
Usage
from spakky.auth import (
AuthInvocation,
CredentialCarrier,
CredentialCarrierKind,
CredentialCarrierLocation,
)
from spakky.plugins.oidc import OidcAuthenticationProvider, OidcProviderConfig
provider = OidcAuthenticationProvider(
config=OidcProviderConfig(
issuer="https://issuer.example.test",
audience="api://spakky",
client_id="spakky-client",
)
)
auth_context = provider.authenticate(
CredentialCarrier(
kind=CredentialCarrierKind.BEARER_TOKEN,
location=CredentialCarrierLocation.AUTHORIZATION_HEADER,
material="eyJ...",
name="Authorization",
scheme="Bearer",
),
AuthInvocation(boundary="http", operation="GET /documents"),
)
OidcProviderConfig controls claim mapping via roles_claim, scopes_claim,
tenant_claim, display_name_claim, and retained_claim_names. The default
scope claim accepts the standard space-delimited scope string; role and custom
scope claims may also use string arrays.
authenticate_result() is available for boundary adapters that prefer a
provider-neutral AuthorizationDecision instead of exception handling.
License
MIT License
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
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 spakky_oidc-6.5.0.tar.gz.
File metadata
- Download URL: spakky_oidc-6.5.0.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0e7c989fd20961e7fab980c3b4eb32e62464bc3dc9f12e43162ac5ddd4b1ccd
|
|
| MD5 |
696e83e5bac2ffcc1d2fc1f4e0a36b80
|
|
| BLAKE2b-256 |
bcbb2fbb752840f800519abe90191306bc19bfc141b9afa1368ee8ee3570d880
|
Provenance
The following attestation bundles were made for spakky_oidc-6.5.0.tar.gz:
Publisher:
publish-package.yml on E5presso/spakky-framework
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spakky_oidc-6.5.0.tar.gz -
Subject digest:
d0e7c989fd20961e7fab980c3b4eb32e62464bc3dc9f12e43162ac5ddd4b1ccd - Sigstore transparency entry: 1817342194
- Sigstore integration time:
-
Permalink:
E5presso/spakky-framework@c5d3c1d8449d535f43fc14aaf7e9f2ebf1ec1b89 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/E5presso
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-package.yml@c5d3c1d8449d535f43fc14aaf7e9f2ebf1ec1b89 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file spakky_oidc-6.5.0-py3-none-any.whl.
File metadata
- Download URL: spakky_oidc-6.5.0-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a0ce9ef88bc0789084092008cd90bea1f50d20e6b12c351a7e8d5050f0d8854
|
|
| MD5 |
75f2737fc4242c89a779399903589a80
|
|
| BLAKE2b-256 |
96ff75097d422d25b89f753e32264ad381441cf1e73152c8a2aaf50115150af1
|
Provenance
The following attestation bundles were made for spakky_oidc-6.5.0-py3-none-any.whl:
Publisher:
publish-package.yml on E5presso/spakky-framework
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spakky_oidc-6.5.0-py3-none-any.whl -
Subject digest:
9a0ce9ef88bc0789084092008cd90bea1f50d20e6b12c351a7e8d5050f0d8854 - Sigstore transparency entry: 1817342295
- Sigstore integration time:
-
Permalink:
E5presso/spakky-framework@c5d3c1d8449d535f43fc14aaf7e9f2ebf1ec1b89 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/E5presso
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-package.yml@c5d3c1d8449d535f43fc14aaf7e9f2ebf1ec1b89 -
Trigger Event:
workflow_dispatch
-
Statement type: