Two-Factor Authentication is a more secure way of logging in to a website. In addition to entering a password online, a user has to enter a random verification code generated at login time. This combination of passwords makes it easier to safeguard your applications.
To install your application on your computer follow these steps:
- Clone this repository.
- Run
pip install -r requirements.txt
to import all the dependencies. - Add your twilio credentials to your shell environment. From the terminal, run
echo "export TWILIO_ACCOUNT_SID=<your sid>" >> ~/.bashrc
echo "export TWILIO_AUTH_TOKEN=<your auth token>" >> ~/.bashrc
- Set your twilio phone number (PHONE_NUMBER) in the config.py
- Run the application with
python app.py
. - Go to
http://localhost:5000
in your address bar to connect to the application.
There are three steps involved in building a two-factor authentication system.
-
Collect the username, phone number, and the user's preferred method of contact.
-
Next, Generate and send that password via a second (non-email/web) channel that an attacker is unlikely to have.
-
Finally, compare our originally generated password against the submitted password.