Skip to content

This article will teach you how to secure a FastAPI app by implementing two-factor (2FA) authentication using TOTP tokens generated by an authenticator application like Chrome's Authenticator extension, Google Authenticator or Authy.

Notifications You must be signed in to change notification settings

wpcodevo/2fa_fastapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Two-factor Authentication (2FA) in FastAPI and Python

This article will teach you how to secure a FastAPI app by implementing two-factor (2FA) authentication using TOTP tokens generated by an authenticator application like Chrome's Authenticator extension, Google Authenticator or Authy.

Two-factor Authentication (2FA) in FastAPI and Python

Topics Covered

  • Run the 2FA FastAPI Project Locally
  • Run the 2FA React.js App Locally
  • Overview of Two-Factor Authentication in FastAPI
  • Setup the FastAPI Project
  • Setup the MongoDB with Docker
  • Create the Validation Schemas with Pydantic
  • Create the Path Operation Functions
    • Register User Handler
    • Login User Handler
    • Generate TOTP Secret Key Handler
    • Verify OTP Token Handler
    • Verify OTP Token Handler
    • Disable 2FA Feature
  • Configure CORS and Register the Routes

Read the entire article here: https://codevoweb.com/two-factor-authentication-2fa-in-fastapi-and-python

Related articles:

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

About

This article will teach you how to secure a FastAPI app by implementing two-factor (2FA) authentication using TOTP tokens generated by an authenticator application like Chrome's Authenticator extension, Google Authenticator or Authy.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages