An example application of how to build a Two-Factor-Authentication system using python, flask, and Bandwidth's API.
This application demonstrates how to authenticate a user using a phone call and keypad inputs.
Table of Contents
- python version = 3.7.0
- Bandwidth Account
How It Works
pip install -r requirements.txt
to install dependencies.
Set the following environmental variables:
FLASK_SECRET_KEY BANDWIDTH_USER_ID BANDWIDTH_API_TOKEN BANDWIDTH_API_SECRET BANDWIDTH_PHONE_NUMBER
to launch the server. You can view the website at localhost:5000.
The website displays a basic user login and user register page. In order to register, a user needs a username, password, and phone number. After the user registers, they will receive a phone call and be asked to input the secret 4 digit code displayed on the website. Successfully inputting this code will register the user, otherwise the registration will fail.
In order to login, a user needs to input their username and password. If the username and password combination is correct, the user will receive a phone call and be asked to press 1 to authenticate the login. If the user presses 1, the login will succeed, otherwise the login will fail.