Introductionο
DRF Auth Kit is a modern Django REST Framework authentication toolkit that provides a complete authentication solution with JWT cookies, social login, multi-factor authentication (MFA), and comprehensive user management.
Why Choose DRF Auth Kit?ο
Built for Modern Development
DRF Auth Kit addresses the limitations of existing authentication packages by providing:
Complete Type Safety: Full type hints with mypy and pyright compatibility
OpenAPI Integration: Automatic schema generation with DRF Spectacular
Modern Architecture: Clean, maintainable codebase with proper separation of concerns
Developer Experience: Comprehensive documentation and testing
Key Featuresο
π Multiple Authentication Types
JWT tokens with refresh support
DRF token authentication
Custom authentication support
Seamless switching between authentication types
πͺ Cookie-Based Security
HTTP-only cookies
Automatic token management
π§ Complete User Management
User registration with email verification
Password reset and change
Email verification workflows
User profile management
π Multi-Factor Authentication (MFA)
Email-based MFA support
Backup codes for account recovery
Extensible MFA handler system
Inspired by django-trench but simplified
π Enhanced Social Authentication
Django Allauth integration
Automatic URL pattern generation
Social account management views
Support for 50+ providers
π Internationalization
Built-in support for 57 languages
Major languages include: English, Spanish, French, German, Chinese, Japanese, Korean, Vietnamese, Russian, Arabic, Portuguese, Italian, Dutch, and more
Translation support for all authentication messages and MFA responses
π Superior Developer Experience
Full type hints with mypy and pyright
Complete DRF Spectacular integration for OpenAPI schema generation
Even custom authentication generates proper API documentation
Comprehensive test coverage (>95%)
Auto-generated API documentation with interactive UI
Easy customization from views to serializers
Architecture Overviewο
DRF Auth Kit follows a modular architecture that allows for easy customization and extension:
Core Components:
Authentication System: Pluggable authentication backends (JWT, Token, Custom)
Settings System: Dynamic configuration with lazy imports
URL System: Conditional URL patterns based on configuration
Serializer System: Customizable serializers for all authentication flows
View System: Override any view without breaking functionality
Optional Components:
MFA System: Pluggable multi-factor authentication handlers
Social System: Integration with Django Allauth for social authentication
Cookie System: HTTP-only cookie management with security features
Design Principles:
Override, Donβt Replace: Extend existing components rather than replacing them
Type Safety: Complete type hints throughout the codebase
Documentation: Automatic OpenAPI schema generation
Testing: Comprehensive test coverage with multiple test environments
Security: Security best practices built-in
Getting Startedο
Ready to get started? Head over to the Getting Started guide for installation and setup instructions.
Quick Links:
Getting Started - Installation and basic configuration
Basic Usage - Learn the core authentication features
Social Authentication - Set up social login
Multi-Factor Authentication (MFA) - Enable multi-factor authentication
Customization - Customize the authentication flow
Community and Supportο
Contributing
We welcome contributions! See our Contributing guide for details on how to contribute to DRF Auth Kit.
Issues and Support
Report bugs or request features on GitHub Issues
Check the documentation for common solutions
Review the test cases for usage examples
Changelog
See the Changelog for information about recent changes and updates.