Skip to main content

Minimal SAML2 client

Project description


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.


Create a SAML Request

from minisaml.request import get_request_redirect_url

url = get_request_redirect_url(
    expected_audience='Your SAML Issuer', 

# This line depends on your web framework/server

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 = ...

    response = validate_response(data=saml_response, certificate=certificate, expected_audience='Your SAML Issuer')

# 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.

Files for minisaml, version 21.10
Filename, size File type Python version Upload date Hashes
Filename, size minisaml-21.10-py3-none-any.whl (6.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size minisaml-21.10.tar.gz (5.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page