Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/wpcodevo/2fa_fastapi
- Owner: wpcodevo
- Created: 2022-10-11T20:19:44.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-10-14T06:20:26.000Z (over 2 years ago)
- Last Synced: 2024-05-15T15:32:41.292Z (9 months ago)
- Topics: 2fa, 2fa-python, 2factor, docker, docker-compose, fastapi, fastapi-2fa, fastapi-mongodb, mongodb, two-factor, two-factor-auth, two-factor-authentication
- Language: Python
- Homepage: https://codevoweb.com/two-factor-authentication-2fa-in-fastapi-and-python
- Size: 9.77 KB
- Stars: 5
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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 RoutesRead 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)