PHP Classes

PHP Multi Factor Authentication: 2 factor authentication independent of the vendor

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 140 All time: 9,211 This week: 71Up
Version License PHP version Categories
multi_factor 1.0MIT/X Consortium ...7Cryptography, Security, PHP 7
Description 

Author

This package implements 2 factor authentication independent of the vendor.

It can generate one time passwords using either HOTP (Event-based One-Time Password) and TOTP (Time-based One-Time Password).

Currently the package provides one OTP implementation using Google Auth vendor.

Picture of Scott Arciszewski
  Performance   Level  
Name: Scott Arciszewski <contact>
Classes: 37 packages by
Country: United States United States
Age: ???
All time rank: 1173170 in United States United States
Week rank: 22 Up4 in United States United States Up
Innovation award
Innovation award
Nominee: 28x

Winner: 1x

Documentation

Multi-Factor

Build Status

Designed to be a vendor-agnostic implementation of various Two-Factor Authentication solutions.

Developed by Paragon Initiative Enterprises for use in our own projects. It's released under a dual license: GPL and MIT. As with all dual-licensed projects, feel free to choose the license that fits your needs.

Requirements

Installing

composer require paragonie/multi-factor

Example Usage

<?php
use ParagonIE\MultiFactor\OneTime;
use ParagonIE\MultiFactor\OTP\TOTP;

$seed = random_bytes(20);

// You can use TOTP or HOTP
$otp = new OneTime($seed, new TOTP());

if (\password_verify($_POST['password'], $storedHash)) {
    if ($otp->validateCode($_POST['2facode'])) {
        // Login successful    
    }
}

  Files folder image Files (20)  
File Role Description
Files folder imagesrc (2 files, 2 directories)
Files folder imagetest (3 files, 1 directory)
Accessible without login Plain text file .travis.yml Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file phpunit.xml.dist Data Auxiliary data
Accessible without login Plain text file psalm.baseline.xml Data Auxiliary data
Accessible without login Plain text file psalm.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Read me

  Files folder image Files (20)  /  src  
File Role Description
Files folder imageOTP (3 files)
Files folder imageVendor (1 file)
  Accessible without login Plain text file MultiFactorInterface.php Class Class source
  Accessible without login Plain text file OneTime.php Class Class source

  Files folder image Files (20)  /  src  /  OTP  
File Role Description
  Accessible without login Plain text file HOTP.php Class Class source
  Accessible without login Plain text file OTPInterface.php Class Class source
  Accessible without login Plain text file TOTP.php Class Class source

  Files folder image Files (20)  /  src  /  Vendor  
File Role Description
  Accessible without login Plain text file GoogleAuth.php Class Class source

  Files folder image Files (20)  /  test  
File Role Description
Files folder imagefixtures (4 files)
  Accessible without login Plain text file GoogleAuthTest.php Class Class source
  Accessible without login Plain text file HOTPTest.php Class Class source
  Accessible without login Plain text file TOTPTest.php Class Class source

  Files folder image Files (20)  /  test  /  fixtures  
File Role Description
  Accessible without login Plain text file 01af3168cf7dbe47c7...6545389a.qrcode.txt Doc. Documentation
  Accessible without login Plain text file 3532ed4f5457b06c9e...d9f22bce.qrcode.txt Doc. Documentation
  Accessible without login Plain text file 68aa8b264cdc6ddc8a...4ca87a06.qrcode.txt Doc. Documentation
  Accessible without login Plain text file 9efd625902fbeedfda...af65cae5.qrcode.txt Doc. Documentation

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:140
This week:0
All time:9,211
This week:71Up