Skip to content

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.

Notifications You must be signed in to change notification settings

wpcodevo/Django_2FA_Project

Repository files navigation

Django - Implement (2FA) Two-Factor Authentication

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.

Django - Implement (2FA) Two-Factor Authentication

Topics Covered

  • 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:

  1. Two-factor Authentication (2FA) in FastAPI and Python
  2. How to Implement (2FA) Two-factor Authentication in Golang
  3. How to Implement (2FA) Two-factor Authentication in Node.js
  4. How to Implement Two-factor Authentication (2FA) in React.js

About

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.

Topics

Resources

Stars

Watchers

Forks

Packages