A demo that implements 2-factor-authentication in Rails using Device and the Nexmo Verify API.
Tutorial: Two Factor Authentication (2FA) in Ruby on Rails with Devise and Nexmo Verify
The basic-login branch is the starting point of the tutorial and is just a simple Rails 4 app Device and Bootstrap to provide a simple app with a login.
- Clone this repository
- Run
git checkout basic-login
- Run
bundle install
- Run
rails server
- Visit http://localhost:3000/
- Register and login
The two-factor branch is the end point of out tutorial,
adding a before_filter
two our basic login and verifying a user's identity
using their phone number.
The differences between these two branches can be seen here and in our in-dept tutorial.
- Clone this repository
- Run
git checkout two-factor
- Run
bundle install
- Copy
.env.example
to.env
and add your Nexmo API key and secret - Run
rails server
- Visit http://localhost:3000/
- Register and login
This sample is released under the MIT License