Giter Site home page Giter Site logo

2fa-php-demo's Introduction

Plivo Two Factor Auth Example

About

This example shows how Plivo APIs can be used to integrate a two factor authentication system into your own web application. This example is built in PHP.

In other languages:

Node.js Done
Python Done
Ruby Done
.NET Done

Set up

Requirements

Local Development

This application verifies your phone number using the two factor authentication system.

  1. Clone this repo.

    git clone [email protected]:plivo/2fa-php-demo.git    
  2. Change your working directory to 2fa-php-demo

    cd 2fa-php-demo
  3. Install the dependencies using the composer.json file. You can use the below command.

    composer install
  4. Change the placeholders in the config.ini file. You should replace the PLIVO_AUTH_ID, PLIVO_AUTH_TOKEN, & PLIVO_NUMBER placeholders. Note: If you do not want to use PHLO, then set the value toPHLO_ID = null

  5. You can get your auth_id & auth_token from your Plivo Console. Please sign up for a Plivo account if you do not have one already.

    Note: Enter your phone number in E.164 format.

  6. Use the below command to start the app.

    php -S localhost:8000

How it works

  1. Enter your phone number and click on Send Verification Code.
  2. This sends an SMS to that number with a random security code in it. The application now shows a text box to enter this code to verify your mobile number.
  3. Once you get the code in the SMS, enter the code in the text box and click Verify. This will tell you whether the code you entered is correct or not.
  4. If you enter the correct code, then the application knows that the phone number belongs to you and thus the number is verified.

Helper libraries for various languages are available on the Plivo github page.

2fa-php-demo's People

Contributors

nixonsam 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.