--- id: djangosaml2 version: "1.12.0" license: Apache 2.0 license_treatment: permissive maintenance: active --- # djangosaml2 — pysaml2 integration for Django License: permissive · Maintenance: active · Downloads: 503.9K/mo ## What it is and what it does Djangosaml2 is a Django application that wraps the pysaml2 library to implement a SAML2 Service Provider, enabling your Django project to authenticate users via SAML2-compliant identity providers. It handles the core SAML2 protocol flows—HTTP-REDIRECT and HTTP-POST bindings for both SSO and SLO (single logout)—and provides discovery service support and an embedded WAYF (Where Are You From) page. The package depends on defusedxml for secure XML parsing and pysaml2 for the underlying SAML2 protocol implementation. Typical use involves configuring SAML2 metadata and IdP details in Django settings, then routing authentication requests through djangosaml2's views. It's designed for organizations integrating with existing federated identity systems (such as Shibboleth or commercial IdPs) rather than building a new identity provider from scratch. Use it for: - Integrate a Django application with a corporate Shibboleth or ADFS identity provider for enterprise SSO. - Enable federated login across multiple organizations using SAML2 standards without managing passwords. - Add single logout (SLO) support to a Django app so users log out across all federated services at once. - Implement IdP discovery or hinting to route users to the correct identity provider in a multi-tenant setup. - Protect a Django application with SAML2 authentication while maintaining compatibility with modern Django versions. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Integrates SAML2 single sign-on authentication into Django applications using the pysaml2 library, enabling federated identity and SSO workflows. Yes. Djangosaml2 is actively maintained, supports current Django and Python versions, has no known vulnerabilities, and carries a permissive license. Install it if you need SAML2 SSO integration; skip it if your authentication requirements are simpler (e.g., OAuth2, OIDC, or local users). ## Install pip install djangosaml2 uv add djangosaml2 poetry add djangosaml2 ## Installing djangosaml2 Before you install: Low install friction with a pure-Python wheel distribution. Actively maintained with a recent release (178 days ago) and ongoing commits; supports current Django versions (4.2 through 5.2) and Python 3.9–3.13. License in practice: Licensed under Apache 2.0 (permissive), allowing use in commercial and proprietary projects with minimal restrictions beyond attribution and liability disclaimers. Quickstart: pip install djangosaml2 from djangosaml2.views import acs from django.urls import path urlpatterns = [ path('saml2/acs/', acs, name='saml2_acs'), ] Requires Django 4.2+ and Python 3.9+; SAML2 metadata and IdP configuration must be set up separately in Django settings. Verify before relying: - Whether HTTP-REDIRECT and HTTP-POST SSO bindings are fully tested against modern IdP implementations. - Performance characteristics when handling high-volume SSO requests or large SAML2 assertions. - Specific version constraints or compatibility notes for pysaml2 beyond what the package declares. ## Package facts - License: Apache 2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 503.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags django saml2 sso, saml2 service provider django, federated authentication django, django single sign-on, saml2 integration, django identity provider, saml2 bindings django, saml2, sso, federated-auth [View on SkillFed](https://skillfed.io/packages/djangosaml2) · [View on PyPI](https://pypi.org/project/djangosaml2/)