In this article, you'll learn how to add two-factor (2FA) authentication to a Django REST API using TOTP tokens generated by an Authenticator app like Chrome's Authenticator extension, Authy or Google Authenticator.
- Run the Django 2FA API Locally
- Run the Django 2FA API with React.js
- Setup the Django Project
- Create Django Models
- Database Model
- Model Serializer
- Implement the Two-Factor Authentication
- Register User API View
- Login User API View
- Generate OTP API View
- Verify OTP API View
- Validate OTP API View
- Disable 2FA API View
- Create URLs for the API Views
- Create the APP URLs
- Include the Base URL in the Project
- Add CORS Middleware
- Test the Two-Factor Authentication API
- Generate the 2FA QRCode
- Enable the 2FA Feature
- Validate the TOTP
- Disable the 2FA Feature
- Create API Documentation
Read the entire article here: https://codevoweb.com/django-implement-2fa-two-factor-authentication/
Related articles: