2017 © Pedro Peláez
 

library google-authenticator

PHP repository for Google Authenticator

image

leandrolugaresi/google-authenticator

PHP repository for Google Authenticator

  • Friday, May 6, 2016
  • by leandro-lugaresi
  • Repository
  • 1 Watchers
  • 9 Stars
  • 36,405 Installations
  • PHP
  • 1 Dependents
  • 1 Suggesters
  • 2 Forks
  • 2 Open issues
  • 3 Versions
  • 2 % Grown

The README.md

google-authenticator

[DEPRECATED] use the antonioribeiro/google2fa instead!, (*1)

Latest Stable Version Total Downloads Latest Unstable Version License Codeship Status for leandro-lugaresi/google-authenticator, (*2)

Introduction

This is a module to integrate web sites with Google Authenticator., (*3)

Requirements

Installation

  1. Add this project in your composer.json:
    "require": {
        "leandrolugaresi/google-authenticator": "1.0.*"
    }
  1. Now tell the composer to download the repository by running the command:
    $ php composer.phar update

Usage

Step 1 - Register application

Show the QrCode and the form:, (*4)

    $googleAuth = new \GoogleAuthenticator\GoogleAuthenticator();
    $googleAuth->setIssuer('YourApplicationName');
    //save the secretKey to register after
    $_SESSION['secretKeyTemp'] = $googleAuth->getSecretKey();

    // Show the qrcode to register
    //this param is an identifier of the user in this application
    echo $googleAuth->getQRCodeUrl($user->username.'@YourApplicationName');

Verify the code from form and save the secretKey of this user:, (*5)

    $google = new GoogleAuthenticator($_SESSION['secretKeyTemp']);
    $userSubmitCode = $_POST['codeFoo'];
    if ($google->verifyCode($userSubmitCode)) {
        //save the secretKey of this user
    }

Step 2 - Verify Code at login

    $google = new GoogleAuthenticator($user->getSecretKey());
    $userSubmitCode = $_POST['codeFoo'];

    // Verify Code
    if ($google->verifyCode($userSubmitCode)) {

        // OK - aloowed login
    }

The Versions

06/05 2016

dev-master

9999999-dev https://github.com/leandro-lugaresi/google-authenticator

PHP repository for Google Authenticator

  Sources   Download

GPL-3.0

The Requires

 

The Development Requires

php google authenticator

08/10 2014

1.0.1

1.0.1.0 https://github.com/leandro-lugaresi/google-authenticator

PHP 5 Google Authenticator

  Sources   Download

GPL-3.0

The Requires

 

The Development Requires

google php5 authenticator php 5

19/09 2014

1.0.0

1.0.0.0 https://github.com/leandro-lugaresi/google-authenticator

PHP 5 Google Authenticator

  Sources   Download

GPL-3.0

The Requires

 

google php5 authenticator php 5