This repository uses FastAPI for creating webapp and PyOTP Python library is used for generating and verifying one-time passwords.
git clone https://github.com/vinodiOS/two-factor-auth-FastAPI.git
cd two-factor-auth-FastAPI
virtualenv venv
source env/bin/activate
pip install -r requirements.txt
uvicorn main:app --reload
docker-compose up
Follow next steps for setting up user account and generate TOTP using Authenticator app.
Enter the following path to create new user.
https://127.0.0.1:8000/signup/
After entering appropriate details new user would be created and page will be navigated to QR Code.
Use Google Authenticator or Microsoft Authenticator or any other Authenticator app to scan QR code and generate TOTP.
Follow this path to login
https://127.0.0.1:8000/login/
Enter user credentials along with 6 digit TOTP generated by Authenticator app.
And, welcome to your website. You have securely logged into your account.
Please star ✨ repository if you like it. Thank you!