--- id: django-authlib version: "0.18.0" license: MIT license_treatment: permissive maintenance: active --- # django-authlib — Authentication utils for Django License: permissive · Maintenance: active · Downloads: 96.1K/mo ## 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 above — 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 pip install django-authlib uv add django-authlib 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_current - Install friction: low - Maintenance: active - Downloads: 96.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags django passwordless authentication, email-based login django, oauth2 social login django, django authentication backend, cryptographic email signin, django google facebook login, token-based email auth, oauth2, passwordless-auth, email-authentication [View on SkillFed](https://skillfed.io/packages/django-authlib) · [View on PyPI](https://pypi.org/project/django-authlib/)