GithubHelp home page GithubHelp logo

authy-php's Introduction

Packagist version Build Status

PHP Client for Twilio Authy Two-Factor Authentication (2FA) API

Documentation for PHP usage of the Authy API lives in the official Twilio documentation.

The Authy API supports multiple channels of 2FA:

  • One-time passwords via SMS and voice.
  • Soft token (TOTP via the Authy App)
  • Push authentication via the Authy App

If you only need SMS and Voice support for one-time passwords, we recommend using the Twilio Verify API instead. More on how to choose between Authy and Verify here.

Authy Quickstart

For a full tutorial, check out the PHP/Laravel Authy Quickstarts in our docs:

Authy PHP Installation

This library requires PHP 5.6+

Install with composer. The authy/php package is available on Packagist.

Include in your composer.json as follows:

{
    "require": {
        "authy/php": "3.0.5"
    }
}

Usage

To use the Authy client, import AuthyApiClient and initialize it with your production API Key found in the Twilio Console:

$authy_api = new Authy\AuthyApi('#your_api_key');

authy api key in console

2FA Workflow

  1. Create a user
  2. Send a one-time password
  3. Verify a one-time password

OR

  1. Create a user
  2. Send a push authentication
  3. Check a push authentication status

Phone Verification

Phone verification now lives in the Twilio API and has PHP support through the official Twilio helper libraries.

Legacy (V1) documentation here. Verify V1 is not recommended for new development. Please consider using Verify V2.

Contributing

You can use docker to run tests and develop locally without the need to install the dependencies directly in your machine:

git clone [email protected]:authy/authy-php.git
cd authy-php
make docker-build # Creates the docker image
make docker-deps  # Install dependencies (in the `vendor` directory)
make docker-test  # Runs the tests

To contribute, make your changes in a branch and send a Pull Request to the twilio/authy-php repo.

Copyright

Copyright (c) 2011-2020 Authy Inc. See LICENSE for further details.

authy-php's People

Contributors

castis avatar chrisdeeming avatar cmodijk avatar dcu avatar enygma avatar giampy5 avatar goodeath avatar luisuribe avatar merlin-bud avatar robinske avatar rotorsolutions avatar senekis avatar serargz avatar tufla avatar vargasx avatar zqueal 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.