You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have used this library to enable the 2FA in our app. It is working absolutely working fine on my local environment but when we deployed the code on staging it is not able to validate the verification code generated by Google Authenticator app.
Both the environments are using Php 7.3. and according to the the issue #61, the mbstring.func_overload value is already set to 0. The only deference I can see the default timezone. On server it is Europe/London where as in local it is UTC. I have also changed in my local system to Europe/London even it is working fine. Attached is the configuration in php.ini of server for your reference.
I have also made the suggested changes in getCode function as mentioned in the #61.
// last arg: When set to TRUE, outputs raw binary data. FALSE outputs lowercase hexits.
// hex string would be more stable in PHP I guess.
$hm = hash_hmac('SHA1', $time, $secretkey, false);
// last nibble is the last hex symbol now. Just turn it to decimal.
$offset = hexdec(substr($hm, -1));
// as each byte is 2 hex symbols, multiply 'substr' args by 2
// turn resulting hex into binary for compliance with further code
$hashpart = hex2bin(substr($hm, $offset * 2, 8));
But still no luck. It would be a great help if anyone can help on this to resolve.
Thanks and Regards
Ashish
The text was updated successfully, but these errors were encountered:
ashish-devclever
changed the title
Can verify the code generated by Google Authenticator app on deploying the code on server
Can not verify the code generated by Google Authenticator app on deploying the code on server
Nov 2, 2021
ashish-devclever
changed the title
Can not verify the code generated by Google Authenticator app on deploying the code on server
Can not verify the code generated by Google Authenticator app after deploying the code on the server
Nov 2, 2021
Hi,
I have used this library to enable the 2FA in our app. It is working absolutely working fine on my local environment but when we deployed the code on staging it is not able to validate the verification code generated by Google Authenticator app.
Both the environments are using Php 7.3. and according to the the issue #61, the mbstring.func_overload value is already set to 0. The only deference I can see the default timezone. On server it is Europe/London where as in local it is UTC. I have also changed in my local system to Europe/London even it is working fine. Attached is the configuration in php.ini of server for your reference.
I have also made the suggested changes in getCode function as mentioned in the #61.
But still no luck. It would be a great help if anyone can help on this to resolve.
Thanks and Regards
Ashish
The text was updated successfully, but these errors were encountered: