--- id: django-auth-adfs version: "1.16.0" license: BSD-1-Clause license_treatment: permissive maintenance: active --- # django-auth-adfs — A Django authentication backend for Microsoft ADFS and AzureAD License: permissive · Maintenance: active · Downloads: 147.8K/mo ## What it is and what it does django-auth-adfs is a Django authentication backend that delegates user login to Microsoft ADFS (Active Directory Federation Services) or Azure AD. Instead of storing passwords in Django, it redirects users through an OAuth2 flow to your organization's identity provider, then creates or updates Django user accounts based on claims returned from ADFS. It handles the full redirect cycle—login initiation, ADFS callback, token validation via cryptography and PyJWT, and automatic group assignment—so developers can focus on application logic rather than directory integration. The package is designed for intranet and cloud environments where centralized identity management is already in place. It depends on django, requests, urllib3, cryptography, and PyJWT to manage HTTP communication, certificate validation, and token verification. Configuration is done through Django settings, and it provides optional middleware to enforce login across your application and template tags for login/logout links. Use it for: - Enterprise Django applications where users authenticate via corporate Active Directory or Azure AD without storing passwords in the app. - Intranet portals that need single sign-on (SSO) so employees log in once to ADFS and automatically gain access to Django apps. - Multi-tenant SaaS platforms using Azure AD for customer organization authentication and automatic user provisioning. - Django REST Framework APIs that accept ADFS access tokens for stateless, federated authentication. - Organizations migrating from on-premises ADFS to Azure AD while keeping existing Django applications. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Integrates Django applications with Microsoft ADFS and Azure AD for single sign-on authentication, automatically provisioning users and group memberships from directory claims. Yes, if you are building a Django application in an organization using ADFS or Azure AD for identity management. The package is production-stable, actively maintained, has no known vulnerabilities, and handles the complex OAuth2 and token validation logic so you don't have to. Install it only if your deployment environment has an ADFS or Azure AD endpoint already configured; it is not useful for standalone Django apps or those using other identity providers. ## Install pip install django-auth-adfs uv add django-auth-adfs poetry add django-auth-adfs ## Installing django-auth-adfs Before you install: Low install friction with a pure-Python wheel distribution. Actively maintained as of 2026-01-08 with recent commits, and supports current Django versions (4.2 through 6.0) and Python 3.9–3.14. License in practice: BSD-1-Clause is a permissive open-source license with minimal restrictions on use, modification, and distribution in both commercial and private projects. Quickstart: pip install django-auth-adfs # In settings.py: AUTHENTICATION_BACKENDS = ('django_auth_adfs.backend.AdfsAuthCodeBackend',) INSTALLED_APPS = (..., 'django_auth_adfs') AUTH_ADFS = { 'SERVER': 'adfs.yourcompany.com', 'CLIENT_ID': 'your-client-id', 'RELYING_PARTY_ID': 'your-rpt-name', } # In urls.py: path('oauth2/', include('django_auth_adfs.urls')) Requires ADFS or Azure AD server endpoint configured with a client ID and relying party trust; certificate bundle path may be needed for on-premises ADFS. Verify before relying: - Whether the package works with Django versions beyond 6.0 or Python 3.14 in production (classifiers list them but latest release is 2026-01-08). - Performance characteristics when handling large numbers of concurrent ADFS authentication requests. - Compatibility with non-standard ADFS claim mappings or custom identity providers. ## Package facts - License: BSD-1-Clause (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 147.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags django adfs authentication, azure ad django login, active directory django sso, django oauth2 adfs, microsoft adfs django backend, authentication, enterprise-identity, sso [View on SkillFed](https://skillfed.io/packages/django-auth-adfs) · [View on PyPI](https://pypi.org/project/django-auth-adfs/)