/sms2fa-flask

SMS Two Factor Authentication implementation with Flask and Twilio

Primary LanguagePython

Twilio

SMS Two-Factor Authentication

Build Status

SMS Two-Factor Authentication (SMS-2FA) helps keep your user accounts secure by validating two "factors" of identity. Most login systems only validate a password known by the user. You can make it harder for evildoers to compromise a user account by also validating something a user has, such as their mobile phone.

Local Development

This project is built using Flask web framework.

  1. First clone this repository and cd into it.

    $ git clone git@github.com:TwilioDevEd/sms2fa-flask.git
    $ cd sms2fa-flask
  2. Create a new virtual environment.

  3. Install the dependencies.

    pip install -r requirements.txt
  4. Copy the sample configuration file and edit it to match your configuration.

    $ cp .env.example .env

    You can find your TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN in your Twilio Account Settings. You will also need a TWILIO_NUMBER, which you may find here.

    Run source .env to export the environment variables.

  5. Run the migrations.

    Our app uses SQLite, so you probably will not need to install additional software.

    python manage.py db upgrade
  6. Make sure the tests succeed.

    $ coverage run manage.py test
  7. Start the server.

    python manage.py runserver
  8. Check it out at: http://localhost:5000/.

Meta

  • No warranty expressed or implied. Software is as is. Diggity.
  • MIT License
  • Lovingly crafted by Twilio Developer Education.