Skip to main content

MiniSAML

Code style: black CircleCI Documentation Status

Absolutely minimalistic SAML 2 client. Does not support the full SAML 2 specification, on purpose. It only supports requests via HTTP Redirect and responses via HTTP POST.

Usage

Create a SAML Request

from minisaml.request import get_request_redirect_url

url = get_request_redirect_url(
    saml_endpoint="https://your-idp.invalid/sso-endpoint/",
    expected_audience="Your SAML Issuer",
    acs_url="https://you.web-site.invalid/saml/acs/"
)

# This line depends on your web framework/server
redirect_user_to_url(url)

Validate and parse the SAML Response

from minisaml.response import validate_response

# This line depends on your web framework/server
saml_response = get_SAMLResponse_form_data_as_bytes()

# Load the x509 certificate as a cryptography.x509.Certificate somehow
certificate = ...

try:
    response = validate_response(
        data=saml_response,
        certificate=certificate,
        expected_audience="Your SAML Issuer",
        idp_issuer="https://your-idp.invalid/issuer/"
    )
except:
    handle_invalid_response_somehow()

# response is a minisaml.response.Response object

Release files for minisaml 26.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 minisaml 26.1
File Size Uploaded
minisaml-26.1.tar.gz 5.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for minisaml 26.1
File Interpreter ABI Platform
minisaml-26.1-py3-none-any.whl Python 3 none any Details

Total release size: 13.6 kB

Release files / minisaml-26.1.tar.gz

Download URL minisaml-26.1.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d92d6d1c5f340f7dae0f0e12528e268ae33735b2e7917e4fac5a51b782253f97
BLAKE2b-256 checksum
How to use checksums
d9c78792a4af5d74954228fb66dc8e536739f7a3a2a95b77bdb17a08ad0a8004
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Jan 27, 2026.

Transparency log

Release files / minisaml-26.1-py3-none-any.whl

Download URL minisaml-26.1-py3-none-any.whl
Size 7.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
44d2a67c135f3a2053bc32e9be7825c2987b08fae775aaebb544dd523c0f692f
BLAKE2b-256 checksum
How to use checksums
5b075b9293631e13acc9ab9056ac83c21ba149c11b40d9132757fd5b4ee424e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Jan 27, 2026.

Transparency log
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