djangosaml2
pysaml2 integration for Django
Decision gist · record as of 2026-08-14
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).AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Django 4.2+ and Python 3.9+; SAML2 metadata and IdP configuration must be set up separately in Django settings.
- 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 · maintenance · safety
Apache 2.0 (permissive) — Licensed under Apache 2.0 (permissive), allowing use in commercial and proprietary projects with minimal restrictions beyond attribution and liability disclaimers.
last release 2026-02-17 (178 days) · last repo commit 2026-02-17 · 272 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 503,856 downloads/mo, #6,300 on PyPI
Alternatives
Verify before relying
pip install djangosaml2
from djangosaml2.views import acs
from django.urls import path
urlpatterns = [
path('saml2/acs/', acs, name='saml2_acs'),
]- 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.
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 on this page. Verify before relying on it.
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
djangosaml2 on PyPI
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.
Requires Django 4.2+ and Python 3.9+; SAML2 metadata and IdP configuration must be set up separately in Django settings.
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'),
]
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 the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagesdefusedxmlDjangopysaml2 |
| Maintenance | Actively maintained 178 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 503,856 / month, #6,300 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: DjangoFramework :: Django :: 4.2Framework :: Django :: 5.0Framework :: Django :: 5.1Framework :: Django :: 5.2Intended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Internet :: WWW/HTTPTopic :: Internet :: WWW/HTTP :: WSGITopic :: SecurityTopic :: Software Development :: Libraries :: Application Frameworks |
Evidence: djangosaml2-1.12.0-py2.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 › “django saml2 sso”
- djangosaml2Integrates SAML2 single sign-on authentication into Django…
- djangosaml2idp2Implements the SAML 2.0 Identity Provider side for Django…
- grafana-django-saml2-authA compatibility shim that redirects to django-saml2-auth-community,…
Give your agent the search over MCP, or paste the wish link into any chat.
More WWW/HTTP packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
h11 is a pure-Python HTTP/1.1 protocol implementation that handles parsing and serializing HTTP messages without any built-in I/O, letting you integrate it with any network layer you choose.
HTTPX is a fully featured HTTP client library for Python that provides both sync and async APIs, with support for HTTP/1.1 and HTTP/2, plus an integrated command-line client.
Install it if you are building new projects or modernizing existing ones that rely on HTTP.
A minimal low-level HTTP client library that sends HTTP requests with thread-safe and task-safe connection pooling, supporting HTTP/1.1, HTTP/2, proxies, and both sync and async interfaces.
aiohttp is an async HTTP client and server framework built on asyncio, supporting both WebSockets and middleware-based routing for building concurrent web applications.
Install it if you need async HTTP client or server capabilities in asyncio-based applications.
See also djangosaml2idp2 · python3-saml · grafana-django-saml2-auth · pysaml2 · python-cas · types-pysaml2 · djangorestframework-simplejwt · requests-negotiate-sspi · django-auth-adfs · python-openid