Skip to main content

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.

Metadata

Release files for apron-saml 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for apron-saml 0.0.1
File Size Uploaded Provenance
apron_saml-0.0.1.tar.gz 30.1 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for apron-saml 0.0.1
File Interpreter ABI Platform
apron_saml-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 43.3 kB

Release files / apron_saml-0.0.1.tar.gz

Download URL apron_saml-0.0.1.tar.gz
Size 30.1 kB
Tags Source
SHA-256 checksum
How to use checksums
5af622d1cf9d97b6b1698155a8e34f46697226435eda8e6e6c0f35d2f09391df
BLAKE2b-256 checksum
How to use checksums
10098f07aa1ac1b9d03c3ad9a35cd2c525cde54b363f670878200319f1a897bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 28, 2026.

Transparency log

Release files / apron_saml-0.0.1-py3-none-any.whl

Download URL apron_saml-0.0.1-py3-none-any.whl
Size 13.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6bc128e49a48e0d6d78ba7a9eda99d090fc1f9efabfea9b32356b005cb8a4590
BLAKE2b-256 checksum
How to use checksums
13ed22c53ab99cfbb64c767d2473420e0eb350ef27cc075d615d1b67cca27682
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 28, 2026.

Transparency log

Security for apron-saml 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for apron_saml-0.0.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page