Home / Companies / Twilio / Blog / Post Details
Content Deep Dive

Add Two-Factor Authentication to a Python Flask Application with Twilio Verify

Blog post from Twilio

Post Details
Company
Date Published
Author
Miguel Grinberg
Word Count
3,927
Language
English
Hacker News Points
-
Summary

Twilio Verify is an API that allows users to send verification codes via SMS or voice calls, which can be used for two-factor authentication in Flask applications. To add two-factor authentication to a Flask application with Twilio Verify, you need to install the required libraries, create a new module for the high-level functions of the Twilio Verify API, and store the user's phone number in the database. The login route needs to be modified to handle users with two-factor authentication enabled, and a new verification route is added to prompt the user to enter a verification token. A form with a submit button is presented for disabling two-factor authentication.