Skip to content

NTICompass/PHP-GAuth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

Google Authenticator for PHP

This is a Google Authenticator class for PHP.
It requires a base32 implementation, you can use mine: https://github.com/NTICompass/PHP-Base32

Usage:

Generate QR Code for user to scan:

<?php
  require_once('GAuth.php');
  $auth = new GAuth;
  $key = $auth->getKey();
  echo '<img src="'.$auth->QRCode('YourDomain.com').'" />';
?>

Verifying code:

<?php
  require_once('GAuth.php');
  $auth = new GAuth;
  // otp is the code from the authenticator
  // key is the $key from the above example
  $valid = $auth->verify($_GET['otp'], $_GET['key']);	          
?>

About

Google Authenticator for PHP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages