Code Monkey home page Code Monkey logo

otp-authentication-in-rails-api.'s Introduction

Authenticate your API with OTP

  • Authenticate your Rails API with Twilio

Clone the repo

[email protected]:Njunu-sk/OTP-Authentication-in-Rails-API..git
bundle install
  • Run spec files
bundle exec rspec

specs

Add your env configurations

REDIS_URL=redis://127.0.0.1:XXXX/0
AUTH_TOKEN=XXXXXXXXXXXXXXXXXXXXXXXX
SERVICE_SID=XXXXXXXXXXXXXXXXXXXXXXXX
ACCOUNT_SID=XXXXXXXXXXXXXXXXXXXXXXXX
  • Get service id from Verify Service Twilio

  • Make sure you have sidekiq installed.

  • Start sidekiq and rails server

bundle exec sidekiq
rails s

Interacting with your API

  • Make sure you have postman installed

  • Visit localhost:3000/send_otp_code, this is a POST request, we are prompting Twilio to send us an otp.

Send OTP

  • Check the logs

Send OTP logs

  • Replace phonenumber and country code.

  • You will receive a valid code in your mobile.

Create a User

  • Visit localhost:3000/user, this is a POST request.

Send OTP logs

  • Check logs

Send OTP logs

  • You have Authenticated a User with OTP.

otp-authentication-in-rails-api.'s People

Contributors

njunu-sk avatar

Watchers

 avatar

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.