skillfed

mozilla-django-oidc

A lightweight authentication and access management library for integration with OpenID Connect enabled authentication services.

mozilla-django-oidc v5.0.2 1.1M downloads/30d#4,303 on PyPI553
Copyleft license MPL-2.0 AGING released

What it is and what it does

mozilla-django-oidc is a lightweight Django authentication backend that connects your application to OpenID Connect identity providers. It handles the OIDC authorization code flow to authenticate users against external identity services, storing minimal authentication artifacts in your Django session. The library is designed around simplicity and security: it supports custom authentication backend overrides for site-specific logic, has been audited by Mozilla InfoSec, and targets modern Django versions (4.2 through 5.2) with Python 3.10+.

The package depends on Django, pyjwt, requests, and cryptography to manage JWT token validation, HTTP communication with the OIDC provider, and cryptographic operations. It is primarily used to offload user authentication to a centralized identity provider—useful for single sign-on scenarios, federated authentication, or integration with Mozilla's own authentication infrastructure.

Use it for:

  • Integrate a Django application with a corporate or institutional OpenID Connect provider for centralized user authentication.
  • Implement single sign-on (SSO) across multiple Django applications using a shared OIDC identity provider.
  • Delegate user authentication to an external identity service while maintaining custom authorization logic in Django.
  • Add Mozilla-specific authentication and authorization features to a Django application.
  • Build a multi-tenant Django application where each tenant connects to its own OIDC provider.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Integrates Django applications with OpenID Connect identity providers to handle authentication and authorization through OIDC-enabled services.

Yes, with conditions. The package is production-stable, widely used (1.1M monthly downloads), audited by Mozilla InfoSec, and has no known vulnerabilities. However, maintenance is aging (238 days since last release); verify that Django 5.2 compatibility is current for your version before adopting. If you need OIDC authentication in Django and can accept the MPL-2.0 copyleft license, this is a solid choice.

Install

mozilla-django-oidc on PyPI

pip

pip install mozilla-django-oidc

uv

uv add mozilla-django-oidc

poetry

poetry add mozilla-django-oidc

Installing mozilla-django-oidc

Before you install

Low install friction with a pure-Python wheel distribution. Maintenance status is aging—last release was 238 days ago—but the repository remains active with a recent commit on 2026-01-07 and no archived status.

License in practice

Licensed under MPL-2.0 (copyleft). You must disclose source code modifications and distribute under the same license if you modify and redistribute the package, but can use it in proprietary applications without distributing the library itself.

Quickstart

pip install mozilla-django-oidc

from mozilla_django_oidc.auth import OIDCAuthenticationBackend

# Add to Django AUTHENTICATION_BACKENDS
AUTHENTICATION_BACKENDS = [
    'mozilla_django_oidc.auth.OIDCAuthenticationBackend',
]

Requires Django 4.2 or later and Python 3.10 or later; OIDC provider endpoint must be configured in Django settings.

Verify before relying

  • Whether the package supports OIDC implicit flow or only authorization code flow as stated in design principles.
  • Current compatibility with Django 5.2 given the aging maintenance status and 238-day release gap.
  • Whether custom backend overrides are documented with examples for common use cases.

Package facts

License MPL-2.0 (copyleft)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 4 — Django, pyjwt, requests, cryptography
Maintenance aging — 238 days since the last release
Last repo commit
First released
Downloads 1,143,073/month — #4,303 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: mozilla_django_oidc-5.0.2-py3-none-any.whl

Keywords: mozilla-django-oidc

Development Status :: 5 - Production/StableFramework :: DjangoFramework :: Django :: 4.2Framework :: Django :: 5.0Framework :: Django :: 5.1Framework :: Django :: 5.2Intended Audience :: DevelopersNatural Language :: EnglishOperating System :: MacOSOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

django openid connect authenticationoidc django integrationdjango sso authenticationopenid connect provider djangodjango oauth2 oidcdjango identity provideroidc authorization code flow
authenticationoidcsso

More WWW/HTTP packages