PHPGangsta / GoogleAuthenticator

PHP class to generate and verify Google Authenticator 2-factor authentication

Home Page:http://phpgangsta.de/4376

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question: How do i check the Code from the App Google Authenticator?

theredcmdcraft opened this issue · comments

I got a code from the App. like 050 221. How do i check the Code if it is right?

`$authenticator = new PHPGangsta_GoogleAuthenticator();

$secret = '3JMZE4ASZRIISJRI'; //The users secret key
$key= '183036' ; //The number generated by app.

$checkKey = $authenticator->verifyCode($secret, $key, 0);

if ($checkKey )
{
echo 'Validated Succesfully';

} else {
echo 'FAILED';
}`