How to Set Up 2FA in Under Five Minutes

Keeping data safe is hard when users insist on using awful passwords.

Learn More

How to Set Up 2FA in Under Five Minutes

Demonstrating that protecting users of your websites and apps is easy, Twilio Account Security evangelist Phil Nash shows how to set up two-factor authentication in under five minutes—which is something you’ll need to access his site “Super Secret Puppies.”

Phil uses the twilio 2FA API to implement two-factor authentication in Rails 4 apps using Devise, the most popular authentication framework for Rails. He takes a basic Rails application, adds user accounts with Devise, and makes them extra secure by enabling two-factor authentication.

Short on time? Here are the top takeaways:

  • With Devise, adding two-factor authentication using the Twilio API is straightforward. Simply add an initializer for Twilio 2FA, enter an API key, run an install command, and migrate the database.
  • There are just three API calls to make two-factor authentication work: the first creates a user, the second initiates an authentication request and the third validates the response to the request.
  • Want to learn more about Devise? Check out the tutorial on securing your user accounts using just Twilio and Rails.