pysaml2
Python implementation of SAML Version 2 Standard
Decision gist · record as of 2026-08-14
Yes, with a license verification step. PySAML2 is a mature, widely-used implementation of a critical standard for enterprise identity federation. Install friction is low, security vulnerabilities are absent, and it supports current Python versions. However, resolve the unclear license status before committing to production use. The aging maintenance status is not a blocker given the stable repository state and active community.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires the xmlsec binary to be installed on the system (e.g., apt-get install xmlsec1 on Linux, brew install libxmlsec1 on macOS).
- PySAML2 wraps this external tool for cryptographic operations.
- Low install friction with a pure-wheel distribution.
License · maintenance · safety
(unclear) — License treatment is unclear—neither SPDX nor raw license metadata is available in the package metadata. Before adopting, verify the actual license terms directly from the repository or project documentation to ensure compliance with your use case.
last release 2025-10-07 (311 days) · last repo commit 2026-02-11 · 609 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 2,595,971 downloads/mo, #2,975 on PyPI
Alternatives
Verify before relying
pip install pysaml2
import pysaml2
from pysaml2 import client
from pysaml2 import config- Specific SAML2 profiles and bindings supported beyond the core standard
- Performance characteristics with large numbers of assertions or metadata
- Compatibility with specific identity providers or SAML2 implementations
- Whether the aging maintenance status reflects stability or reduced active development
What it is and what it does
PySAML2 is a pure Python library implementing the OASIS SAML Version 2 Standard, enabling you to build SAML2 service providers or identity providers. It handles core SAML2 protocols, assertions, bindings, and metadata as specified by the standard, and was originally designed for WSGI environments with extensions for other frameworks.
The package depends on cryptography, defusedxml, pyopenssl, python-dateutil, requests, and xmlschema to parse and validate SAML2 XML structures. It requires Python 3.9 or later and is maintained by the IdentityPython community. With nearly 2.6 million monthly downloads, it is widely used for enterprise federated authentication and single sign-on integrations.
Use it for
- Build a web application that accepts SAML2 assertions from a corporate identity provider for enterprise SSO
- Implement a SAML2 identity provider to issue assertions for federated access to partner applications
- Parse and validate SAML2 metadata to discover and configure connections with other SAML2 participants
- Handle SAML2 authentication flows in Python web frameworks beyond WSGI using community extensions
- Manage SAML2 bindings and protocols for secure attribute exchange in federation scenarios
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, with a license verification step.
PySAML2 is a mature, widely-used implementation of a critical standard for enterprise identity federation. Install friction is low, security vulnerabilities are absent, and it supports current Python versions. However, resolve the unclear license status before committing to production use. The aging maintenance status is not a blocker given the stable repository state and active community.
Install
pysaml2 on PyPI
Before you install
Low install friction with a pure-wheel distribution. Maintenance status is aging—last release was 311 days ago, though the repository remains active with a recent commit on 2026-02-11 and carries 609 GitHub stars.
Requires the xmlsec binary to be installed on the system (e.g., apt-get install xmlsec1 on Linux, brew install libxmlsec1 on macOS). PySAML2 wraps this external tool for cryptographic operations.
License in practice
License treatment is unclear—neither SPDX nor raw license metadata is available in the package metadata. Before adopting, verify the actual license terms directly from the repository or project documentation to ensure compliance with your use case.
Quickstart
pip install pysaml2
import pysaml2
from pysaml2 import client
from pysaml2 import config
Verify before relying
- Specific SAML2 profiles and bindings supported beyond the core standard
- Performance characteristics with large numbers of assertions or metadata
- Compatibility with specific identity providers or SAML2 implementations
- Whether the aging maintenance status reflects stability or reduced active development
Package facts
| License | Not declared unclear |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 6 packagescryptographydefusedxmlpyopensslpython-dateutilrequestsxmlschema |
| Maintenance | Aging 311 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,595,971 / month, #2,975 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Topic :: Software Development :: Libraries :: Python Modules |
Evidence: pysaml2-7.5.4-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “identity provider python”
- pysaml2PySAML2 is a pure Python implementation of SAML Version 2 Standard…
- python3-samlTurns a Python application into a SAML 2.0 Service Provider, enabling…
- microsoft-kiota-authentication-azureProvides Azure identity authentication for HTTP requests in…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also djangosaml2idp2 · python3-saml · grafana-django-saml2-auth · djangosaml2 · types-pysaml2 · xmlsec · signxml · social-auth-core · requests-negotiate-sspi · social-auth-app-django