Skip to main content

Minimal SAML2 client

Project description

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

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

minisaml-26.1.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

minisaml-26.1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file minisaml-26.1.tar.gz.

File metadata

  • Download URL: minisaml-26.1.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for minisaml-26.1.tar.gz
Algorithm Hash digest
SHA256 d92d6d1c5f340f7dae0f0e12528e268ae33735b2e7917e4fac5a51b782253f97
MD5 00b37cdf33636247151e7dbfa1b5c239
BLAKE2b-256 d9c78792a4af5d74954228fb66dc8e536739f7a3a2a95b77bdb17a08ad0a8004

See more details on using hashes here.

Provenance

The following attestation bundles were made for minisaml-26.1.tar.gz:

Publisher: release.yml on HENNGE/minisaml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file minisaml-26.1-py3-none-any.whl.

File metadata

  • Download URL: minisaml-26.1-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for minisaml-26.1-py3-none-any.whl
Algorithm Hash digest
SHA256 44d2a67c135f3a2053bc32e9be7825c2987b08fae775aaebb544dd523c0f692f
MD5 eed1f19d39cf9cb9c39840916ced1f8b
BLAKE2b-256 5b075b9293631e13acc9ab9056ac83c21ba149c11b40d9132757fd5b4ee424e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for minisaml-26.1-py3-none-any.whl:

Publisher: release.yml on HENNGE/minisaml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page