<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
truesocialmetrics / google-authenticator example snippets
$googleAuth = new \GoogleAuthenticator\GoogleAuthenticator();
$googleAuth->setIssuer('YourApplicationName');
//save the secretKey to register after
$_SESSION['secretKeyTemp'] = $googleAuth->getSecretKey();
// Show the qrcode to register
//this param is an identifier of the user in this application
echo $googleAuth->getQRCodeUrl($user->username.'@YourApplicationName');
$google = new GoogleAuthenticator($_SESSION['secretKeyTemp']);
$userSubmitCode = $_POST['codeFoo'];
if ($google->verifyCode($userSubmitCode)) {
//save the secretKey of this user
}
$google = new GoogleAuthenticator($user->getSecretKey());
$userSubmitCode = $_POST['codeFoo'];
// Verify Code
if ($google->verifyCode($userSubmitCode)) {
// OK - aloowed login
}
bash
$ php composer.phar update
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.