Commit version 1.0

This commit is contained in:
Frank Bischof
2023-01-20 14:21:17 +01:00
parent cc3f1edaef
commit 847e509a1f
4 changed files with 262 additions and 1 deletions

17
generate.php Normal file
View File

@ -0,0 +1,17 @@
<?php
require_once('GoogleAuthenticator.php');
echo "<p>Create token:</p>";
$user = 'MyLoginUsername';
// Generate a new secret for the user, this secret should be stored with the user in a database or make a static setting
$ga = new GoogleAuthenticator();
$secret = $ga->createSecret();
echo "<p>This personal secret should be stored in a database/user table and should never be known to anybody: $secret</p>";
echo "<hr>"
// Generate QR by using Google Charts.
$qrCodeUrl = $ga->getQRCodeGoogleUrl($user, $secret, 'My Environment');
echo "<p>Scan in Google Authenticator or Microsoft Authenticator"
echo "<img src='$qrCodeUrl'>";
?>