Google Authenticator does not valid correct time

Dear Suportor
This one i think is a Keycloak’ bug
In Authentication >> OPT Policy the config below
OTP Type = Time based
OTP Hash Algorithm = SHA1
Number of Digits = 6
Look Ahead Window = 1
OTP Token Period = 30


I Test with one user with Required User Actions = Config OTP
But the in second step I entered code in Mobile Google Authenticator.
Keycloak alway login success after one minute code generance

Then I did like bellow

  1. Update Database
    update realm set otp_policy_counter = 0 where id = ‘egp’;
    update realm set otp_policy_window = 0 where id = ‘egp’;
    commit;
    SELECT * FROM realm;

  2. Check config againt

  1. Restart Keycloak server
    ./jboss-cli.sh --connect command=:reload

  2. Test
    Result test correct after change


Please, help me check if my config is not correct

Thank you

And I think the bug in “org.keycloak.models.utils.TimeBasedOTPvalidateTOTP” function