1 頁 (共 1 頁)

Google Authenticator

發表於 : 2013-01-29 16:00:18
yehlu
PHP Client
https://github.com/chregu/GoogleAuthenticator.php
Android
https://play.google.com/store/apps/deta ... F0b3IyIl0.
iOS
https://itunes.apple.com/tw/app/google- ... ?l=zh&mt=8

代碼: 選擇全部

<?php
include_once("lib/GoogleAuthenticator.php");

$secret = 'XVQ2UIGO75XRUKJO';
$time = floor(time() / 30);
$code = "846474";

$g = new GoogleAuthenticator();

print "Current Code is: ";
print $g->getCode($secret);

print "\n";

print "Check if $code is valid: ";

if ($g->checkCode($secret,$code)) {
    print "YES \n";   
} else {
    print "NO \n";
}

$secret = $g->generateSecret();
print "Get a new Secret: $secret \n";

print "The QR Code for this secret (to scan with the Google Authenticator App: \n";
print $g->getURL('chregu','example.org',$secret);
print "\n";