Coder Social home page Coder Social logo

twiliodeved / authy2fa-sinatra Goto Github PK

View Code? Open in Web Editor NEW
2.0 23.0 1.0 1.37 MB

2FA Implementation with Authy and Sinatra

Home Page: https://www.twilio.com/docs/tutorials/walkthrough/two-factor-authentication/ruby/sinatra

Ruby 72.96% CSS 4.00% JavaScript 7.25% Shell 0.73% Haml 15.05%
authy twilio ruby sinatra 2fa two-factor-authentication

authy2fa-sinatra's Introduction

Two-Factor Authentication with Ruby and Sinatra

This example application demonstrates how to use Authy as the two-factor authentication provider using Authy and Sinatra.

Build and test

Get started

  1. First clone this repository and cd into it

    $ git clone https://github.com/TwilioDevEd/authy2fa-sinatra.git
    $ cd authy2fa-sinatra
  2. Install the dependencies

    bundle
    
  3. Copy the sample configuration file and edit it to match your configuration.

    cp .env.example .env
  4. Make sure the tests succeed

    $ bundle exec rake
    
  5. Run the application

    $ bundle exec rackup
  6. To enable Authy OneTouch to use the callback endpoint you exposed, your development server will need to be publicly accessible. We recommend using ngrok to solve this problem.

    $ ngrok http 9292
  7. Go to your Twilio Console and register the callback endpoint under your Authy app's Push Authentication. Your endpoint will look like http://[your-subdomain].ngrok.io/authy/callback.

  8. Check it out at http://[your-subdomain].ngrok.io

That's it!

Configure Development vs Production Settings

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.

Meta

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

authy2fa-sinatra's People

Contributors

acamino avatar dependabot-preview[bot] avatar dprothero avatar fefi95 avatar hortega avatar jefflinwood avatar joliveros avatar kathyguerron avatar po5i avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

gregbaugues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.