Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/wpcodevo/2fa_fastapi

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.
https://github.com/wpcodevo/2fa_fastapi

2fa 2fa-python 2factor docker docker-compose fastapi fastapi-2fa fastapi-mongodb mongodb two-factor two-factor-auth two-factor-authentication

Last synced: 2 months ago
JSON representation

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.

Awesome Lists containing this project

README

        

# 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](https://codevoweb.com/wp-content/uploads/2022/10/Two-factor-Authentication-2FA-in-FastAPI-and-Python.webp)

## 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](https://codevoweb.com/two-factor-authentication-2fa-in-fastapi-and-python)

Related articles:

1. [How to Implement Two-factor Authentication (2FA) in React.js](https://codevoweb.com/two-factor-authentication-2fa-in-reactjs)
2. [How to Implement (2FA) Two-factor Authentication in Golang](https://codevoweb.com/two-factor-authentication-2fa-in-golang)
3. [How to Implement (2FA) Two-factor Authentication in Node.js](https://codevoweb.com/two-factor-authentication-2fa-in-nodejs)