Implemented 2FA TOTP with Google Authenticator

This commit is contained in:
root
2019-06-16 22:33:55 -04:00
parent bc8091ae49
commit e247ad4ee4
13 changed files with 564 additions and 125 deletions

View File

@@ -22,6 +22,22 @@
<h1>User Agent: <?php echo $_SERVER['HTTP_USER_AGENT']; ?>
<p>This is a great starting point for new custom pages.</p>
<?php
require_once('rfc6238.php');
$secretkey = 'GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ';
$currentcode = '739453';
if (TokenAuth6238::verify($secretkey,$currentcode)) {
echo "Code is valid\n";
} else {
echo "Invalid code\n";
}
print sprintf('<img src="%s"/>',TokenAuth6238::getBarCodeUrl('','',$secretkey,'My%20App'));
print TokenAuth6238::getTokenCodeDebug($secretkey,0);
?>
<h3><?php echo $config_quote_email_subject; ?></h3>