forked from chregu/GoogleAuthenticator.php
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.php
More file actions
Latest commit
28 lines (20 loc) · 573 Bytes
/
Copy pathexample.php
File metadata and controls
28 lines (20 loc) · 573 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
include_once("lib/GoogleAuthenticator.php");
$secret = 'XVQ2UIGO75XRUKJO';
$time = floor(time() / 30);
$code = "846474";
$g = newGoogleAuthenticator();
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";