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

Google Auth app and system generated codes are different

rnkhouse opened this issue · comments

I entered secret in google authenticator app. It generates random code in every few seconds. But, when I match with my code it's different.

$this->load->library('GoogleAuthenticator');
$oneCode = $this->googleauthenticator->getCode($secret);

$oneCode is different than I see in google app.

Most often it's a time problem, so the clock is not synchronized between the mobile phone and the server. Please check if both systems have the same time, then they should generate the same code (with the same secret used).

that is a problem indid. When the secret is long(maybe morethan 16length),The code is different from google app.