Current code is always different to authenticator

58 views
Skip to first unread message

Kristian Lake

unread,
Jul 8, 2020, 4:51:33 PM7/8/20
to sonata-devs
Hi guys, 

I have setup the example.php and the current code is never the same as the code on the authenticator.

I am running my code on a windows machine set to UTC +00:00 London.

Inside my php.ini i set the timezone to Europe/London

And inside the Sonata\GoogleAuthenticator class (for testing) i added a line 

date_default_timezone_set('Europe/London');
$this->instanceTime = $instanceTime ?? new \DateTimeImmutable();

The problem is, I cant seem to get back a code that matches the authenticator. I am pretty sure its some kind of timing, but I have tried everything i could think of.

Do you guys have any advice on where I should look next?

Thanks ! :)

Kristian Lake

unread,
Jul 9, 2020, 2:16:04 PM7/9/20
to sonata-devs
Figured it out. The salt I was using wasnt the right length, it just chucked everything else out.
Reply all
Reply to author
Forward
0 new messages