apron-saml
Stateless Service-Provider-side SAML 2.0 protocol library: build AuthnRequests, parse IdP
metadata, decode SAML Responses, and validate assertions — as an importable primitive, never a
service.
Part of the apron-* family of stateless protocol primitives. Like the others, apron-saml owns
protocol mechanics only: it holds no state, opens no sockets, and persists nothing. Storage,
sessions, and the stateful federation belong to the consuming application.
Status: scaffolding. The public surface below is the target API (pending the API-surface ADR); most of it currently raises
NotImplementedError. Track progress in the issue backlog.
Scope
- In scope (v1): SP-side consumption — build authentication requests, parse IdP / generate SP
metadata, decode Responses, and validate assertions (signature, XML-Signature-Wrapping hardening,
Conditions,SubjectConfirmation, replay prevention, optional encrypted-assertion decryption). - Out of scope (v1): issuing assertions (IdP side), Single Logout (SLO), and IdP-initiated SSO — deferred; see the backlog.
All XML-security is delegated to a vetted library, never hand-rolled.
Install
pip install apron-saml
Requires Python 3.11+. Once the XML-security backend lands (tracked in the backlog), a system
xmlsec/libxmlsec1 dependency will be required — installation notes will follow here.
Usage (target API)
from apron_saml import ServiceProvider, SamlConfig
sp = ServiceProvider(
SamlConfig(
entity_id="https://sp.example.com/metadata",
acs_url="https://sp.example.com/saml/acs",
idp_metadata=idp_metadata_xml, # the caller fetches this; apron-saml does no network I/O
)
)
# Outbound: start an SP-initiated login.
authn = sp.build_authn_request(relay_state="/dashboard")
redirect_to = authn.redirect_url()
# Inbound: decode, fully validate, and extract the identity (or raise a SamlError subclass).
identity = sp.process_response(saml_response_b64, expected_in_response_to=authn.request_id)
Every rejection raises a SamlError subclass — there are no boolean-returning validators and no
silent failure.
Development
make setup # bootstrap uv + venv + pre-commit
make test # unit tests
make lint # ruff + ty via pre-commit
License
Apache-2.0.
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 apron_saml-0.0.1.tar.gz.
File metadata
- Download URL: apron_saml-0.0.1.tar.gz
- Upload date:
- Size: 30.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5af622d1cf9d97b6b1698155a8e34f46697226435eda8e6e6c0f35d2f09391df
|
|
| MD5 |
67ebcde470d42295936a45d82ea9e383
|
|
| BLAKE2b-256 |
10098f07aa1ac1b9d03c3ad9a35cd2c525cde54b363f670878200319f1a897bb
|
Provenance
The following attestation bundles were made for apron_saml-0.0.1.tar.gz:
Publisher:
release.yaml on mozilla-ai/apron-saml
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
apron_saml-0.0.1.tar.gz -
Subject digest:
5af622d1cf9d97b6b1698155a8e34f46697226435eda8e6e6c0f35d2f09391df - Sigstore transparency entry: 2276222086
- Sigstore integration time:
-
Permalink:
mozilla-ai/apron-saml@1f1f64dcd514507ade68a45c12752d07a44cd6e1 -
Branch / Tag:
refs/tags/0.0.1 - Owner: https://github.com/mozilla-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@1f1f64dcd514507ade68a45c12752d07a44cd6e1 -
Trigger Event:
release
-
Statement type:
File details
Details for the file apron_saml-0.0.1-py3-none-any.whl.
File metadata
- Download URL: apron_saml-0.0.1-py3-none-any.whl
- Upload date:
- Size: 13.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6bc128e49a48e0d6d78ba7a9eda99d090fc1f9efabfea9b32356b005cb8a4590
|
|
| MD5 |
70735242f1f297b3694589a232089de8
|
|
| BLAKE2b-256 |
13ed22c53ab99cfbb64c767d2473420e0eb350ef27cc075d615d1b67cca27682
|
Provenance
The following attestation bundles were made for apron_saml-0.0.1-py3-none-any.whl:
Publisher:
release.yaml on mozilla-ai/apron-saml
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
apron_saml-0.0.1-py3-none-any.whl -
Subject digest:
6bc128e49a48e0d6d78ba7a9eda99d090fc1f9efabfea9b32356b005cb8a4590 - Sigstore transparency entry: 2276222177
- Sigstore integration time:
-
Permalink:
mozilla-ai/apron-saml@1f1f64dcd514507ade68a45c12752d07a44cd6e1 -
Branch / Tag:
refs/tags/0.0.1 - Owner: https://github.com/mozilla-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@1f1f64dcd514507ade68a45c12752d07a44cd6e1 -
Trigger Event:
release
-
Statement type: