If for some reason you're not able to use Authy, you can implement two factor authentication yourself using SMS messages.
This project is built using the Sinatra web framework.
-
First clone this repository and
cd
into it.git clone [email protected]:TwilioDevEd/sms2fa-sinatra.git cd sms2fa-sinatra
-
Install the dependencies.
bundle install
-
Copy the sample configuration file and edit it to match your configuration.
cp .env.example .env
You can find your
TWILIO_ACCOUNT_SID
andTWILIO_AUTH_TOKEN
in your Twilio Account Settings. You will also need aTWILIO_NUMBER
, you may find here. -
Create development and test databases.
Make sure you have installed PostgreSQL. If on a Mac, I recommend Postgres.app.
createdb sms_two_fa_sinatra createdb sms_two_fa_sinatra_test
-
Make sure the tests succeed.
bundle exec rspec
-
Start the server.
bundle exec rackup
-
Check it out at http://localhost:9292.
By default, this application will run in production mode - stack traces will not be visible in the web browser. If you would like to run this application in development locally, change the APP_ENV
variable in your .env
file.
APP_ENV=development
For more about development vs production, visit Sinatra's configuration page.
- No warranty expressed or implied. Software is as is. Diggity.
- MIT License
- Lovingly crafted by Twilio Developer Education.