2017 © Pedro Peláez
 

library googleauthenticator

Google Authenticator 2-factor authentication

image

wayhood/googleauthenticator

Google Authenticator 2-factor authentication

  • Monday, December 1, 2014
  • by yiitech
  • Repository
  • 1 Watchers
  • 1 Stars
  • 63 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Google Authenticator 2-factor authentication

Google Authenticator 2-factor authentication, (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require --prefer-dist wayhood/googleauthenticator "*"

or add, (*4)

"wayhood/googleauthenticator": "*"

to the require section of your composer.json file., (*5)

Usage

Once the extension is installed, simply use it in your code by :, (*6)

use wh/googleauthenticator/GoogleAuthenticator';

$ga = new GoogleAuthenticator();

$secret = $ga->createSecret();
echo "Secret is: ".$secret."\n\n";

$qrCodeUrl = $ga->getQRCodeGoogleUrl('Blog', $secret);
echo "Google Charts URL for the QR-Code: ".$qrCodeUrl."\n\n";

$oneCode = $ga->getCode($secret);
echo "Checking Code '$oneCode' and Secret '$secret':\n";

$checkResult = $ga->verifyCode($secret, $oneCode, 2); // 2 = 2*30sec clock tolerance
if ($checkResult) {
    echo 'OK';
} else {
    echo 'FAILED';
}

The Versions

01/12 2014

dev-master

9999999-dev

Google Authenticator 2-factor authentication

  Sources   Download

BSD-4-Clause

by Song Yeung

googleauthenticator