skillfed

django-authlib

Authentication utils for Django

django-authlib v0.18.0 96.1K downloads/30d#13,230 on PyPI72
Permissive license MIT Active released

What it is and what it does

django-authlib is a lightweight Django authentication library that replaces password-based login with passwordless alternatives. It supports two main flows: sending cryptographically signed email links for registration and login, or delegating authentication to OAuth2 providers (Google, Microsoft, Facebook, Twitter). The library is intentionally minimal—it provides authentication backends and optional bundled views rather than imposing a full framework, allowing developers to integrate it into existing Django projects with minimal configuration.

The package includes an optional admin OAuth module for restricting Django admin access to users from specific email domains, and a basic user model (little_auth) for projects that don't have a custom user implementation. It relies on requests-oauthlib for OAuth handling and integrates with Django's authentication system via the EmailBackend. Setup requires adding the backend to AUTHENTICATION_BACKENDS and optionally including the app in INSTALLED_APPS for translation support.

Use it for:

  • Add OAuth2 social login (Google, Microsoft, Facebook, Twitter) to a Django site without building OAuth flows from scratch.
  • Implement email-based passwordless registration where users receive signed links instead of setting passwords.
  • Restrict Django admin access to users from a specific email domain using OAuth2 credentials.
  • Replace traditional password authentication in a Django app with email-link-based login for improved security.
  • Integrate a lightweight user model with email-as-username for projects without a custom user implementation.

Worth the install?

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

Provides passwordless authentication for Django using email-based links or OAuth2 from Google, Microsoft, Facebook, and Twitter.

Yes. The package is actively maintained, has no known vulnerabilities, installs with minimal friction, and solves a real problem (passwordless authentication) in a deliberately lightweight way. It's suitable for Django projects of any size that want OAuth2 or email-based login without heavy dependencies. The MIT license poses no restrictions.

Install

django-authlib on PyPI

pip

pip install django-authlib

uv

uv add django-authlib

poetry

poetry add django-authlib

Installing django-authlib

Before you install

Low install friction with a single runtime dependency (requests-oauthlib). Active maintenance with a recent release 43 days ago and ongoing commits.

License in practice

MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.

Quickstart

pip install django-authlib

In settings.py:
AUTHENTICATION_BACKENDS = ['authlib.backends.EmailBackend']
INSTALLED_APPS = [..., 'authlib']

from authlib.google import GoogleOAuth2Client
from authlib import views
# Use views.oauth2 with GoogleOAuth2Client for OAuth login

Requires Django project setup; OAuth providers need client credentials (GOOGLE_CLIENT_ID, etc.) configured in settings; OAUTHLIB_INSECURE_TRANSPORT must be set for development without HTTPS.

Verify before relying

  • Whether the package supports Django versions beyond those implied by the Python 3.9+ requirement.
  • Performance characteristics when handling high-volume email-based authentication flows.
  • Current state of documentation beyond the README excerpt provided.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 1 — requests-oauthlib
Maintenance actively maintained — 43 days since the last release
Last repo commit
First released
Downloads 96,102/month — #13,230 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: django_authlib-0.18.0-py3-none-any.whl

Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: DjangoLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9

Tags

django passwordless authenticationemail-based login djangooauth2 social login djangodjango authentication backendcryptographic email signindjango google facebook logintoken-based email auth
oauth2passwordless-authemail-authentication

More Dynamic Content packages