--- id: python3-saml version: "1.16.0" license: MIT license_treatment: permissive maintenance: aging --- # python3-saml — Saml Python Toolkit. Add SAML support to your Python software using this library License: permissive · Maintenance: aging · Downloads: 9.4M/mo ## What it is and what it does python3-saml is a SAML 2.0 toolkit that converts your Python application into a Service Provider capable of federating with identity providers. It handles the full SSO and SLO lifecycle—both SP-initiated and IdP-initiated flows—and manages assertion encryption, signature validation, and metadata publication. The library is session-less, delegating session management to your application layer, and provides both high-level and low-level APIs for flexibility. The toolkit requires Python 3.7 or later and depends on xmlsec and lxml for XML cryptography and parsing. It implements the SAML 2.0 Web Browser SSO Profile and has been in production use since 2015. The library emphasizes security best practices, including strict mode validation by default and defenses against XML external entity attacks, signature wrapping, and replay attacks. Use it for: - Integrate enterprise SSO into a SaaS application to allow users to authenticate via corporate identity providers - Build a federated B2B platform where partner organizations can authenticate their users without sharing credentials - Implement single logout across multiple applications by handling IdP-initiated SLO requests - Publish SP metadata for discovery and automated configuration by identity provider administrators - Validate digitally signed SAML assertions and encrypted nameIds from trusted identity providers ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Turns a Python application into a SAML 2.0 Service Provider, enabling single sign-on and single logout with identity providers through standardized XML-based federation. Yes, with conditions. The library is mature, permissively licensed, and has no known vulnerabilities. Install friction is low and it covers the full SAML 2.0 SP workflow. However, maintenance is aging (last release 2023-10-09); verify that it supports your IdP's current SAML profile and that you can manage the xmlsec and lxml system dependencies in your deployment environment. Suitable for production use if you can commit to security best practices, especially enabling strict mode. ## Install pip install python3-saml uv add python3-saml poetry add python3-saml ## Installing python3-saml Before you install: Low install friction with no runtime dependencies. Maintenance is aging—last release was 2023-10-09 and last commit 2026-01-14—but the repository remains active and unarchived with a stable user base. License in practice: MIT license permits commercial and private use with minimal restrictions, making it suitable for most deployment contexts. Quickstart: pip install python3-saml Import the toolkit and instantiate with request and settings to handle SSO and SLO flows. Requires xmlsec and lxml system libraries; lxml should be installed from source (not binary) to avoid libxml2 version conflicts with xmlsec. Verify before relying: - Whether xmlsec and lxml system dependencies are pre-installed or require separate setup in typical deployment environments - Current status of the library's compatibility with modern IdP implementations and SAML 2.0 profile updates - Specific API usage patterns and method signatures for SSO/SLO workflows ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: aging - Downloads: 9.4M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags saml service provider, single sign-on sso, saml authentication, identity provider federation, saml2 python, xml security authentication, enterprise sso, saml-federation, sso-authentication, xml-security [View on SkillFed](https://skillfed.io/packages/python3-saml) · [View on PyPI](https://pypi.org/project/python3-saml/)