• Resolved eddxavier

    (@eddxavier)


    Hi,

    Although the time is correct on my server, the OTPs doesn’t match what is on the App.

    I have tried it with both Google Authenticator and Duo Mobile.

    Thanks,

    Eduardo

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author David Anderson

    (@davidanderson)

    Hi,

    The only two inputs in the TOTP algorithm are: 1) the private key and 2) the current time. As such, if the two apps share the private key and produce different codes, it can only be because they vary on time. It’s worth noting that Android apparently (from testing with multiple users) doesn’t mind too much about having time that’s out by several seconds. TOTP codes change every 30 seconds. If you note down a sequence of these in both the plugin (use the ‘Refresh’ link) and in the apps, do they follow the same sequence? Or completely different ones?

    Also – can you post a screenshot (use https://snag.gy if it helps) that shows the current time as reported by the plugin?

    David

    Thread Starter eddxavier

    (@eddxavier)

    Hi David,

    As far as I could observe the codes, they don’t seem to match at all (they don’t seem to be just behind, they are completely different).

    Here is a screenshot of the issue:

    https://snag.gy/6GuDc2.jpg

    https://snag.gy/DoVb3e.jpg

    Thanks again,

    Eduardo

    Plugin Author David Anderson

    (@davidanderson)

    Hi Eduardo,

    The server time shown in the screenshot (1:57 UTC) differs by 6 minutes from the time of your forum post (2:03). Are you sure that the server time is accurate?

    David

    Thread Starter eddxavier

    (@eddxavier)

    Hi David,

    Yes, I’m sure. I collected one more screenshot before posting.

    Let me send you another screenshot with Google UTC clock as a reference.

    https://snag.gy/eLxc6W.jpg

    Thanks,

    Eduardo

    Plugin Author David Anderson

    (@davidanderson)

    How about on the device with Google Authenticator on it? Can you try loading an OTP-code-generating app onto your computer, as a test of a second device?

    Plugin Author David Anderson

    (@davidanderson)

    We did once have someone with a broken PHP install… we tracked down that simple PHP functions like ‘count the length of this string’ returned wrong results. https://www.ads-software.com/support/topic/plugin-didnt-show-secure-code/page/2/ I suppose it’s possible that you might have the same PHP bug as he did. You could try changing to a different PHP version.

    Thread Starter eddxavier

    (@eddxavier)

    Hi David,

    Thank you, the issue was with my phone time settings.

    I tried another OTP provider and the OTPs matched. Once I adjusted my phone time synchronization, it worked on Google Authenticator on my device.

    Thanks again,

    Eduardo

    • This reply was modified 7 years, 1 month ago by eddxavier.
    Plugin Author David Anderson

    (@davidanderson)

    You’re welcome!

    If you find Two Factor Authentication useful, then please give us a positive review, here: https://www.ads-software.com/support/view/plugin-reviews/two-factor-authentication?rate=5#postform

    (If we’re not yet worth 5 stars, then please don’t review, but instead reply here to let us know why not – reviews less than 5 stars bring our average down!).

    Best wishes,
    David

    I appreciate this thread is closed but I have a suggestion on this topic. I had the same problem and called my ISP to correct the server time. In a nutshell, they can’t… If they correct the clock, timestamps all over the system will cause backups to be trashed, Dropbox files to sync in the wrong direction etc.

    The solution in the plugin I’m currently using is “Relaxed Mode” which allows +/- 4 minutes mismatch. No idea how… I suggest you could nick this idea and improve it by allowing the window size to be varied… You should be able to resolve timezone stuff algorithmically too.

    Cheers!

    Plugin Author David Anderson

    (@davidanderson)

    @chasman I’m on mobile Internet right now, but if you keep going through the forums, you’ll find the previously-pasted code for doing that. The default is 2 minutes IIRC.

    Though, as a general thing, I think that trying to work around a web host who gave a reply like that is just a way of deferring your pain. Any competent sysadmin should either a) know how to or b) know how to use Google to find out how to slew time corrections (i.e. have them applied gradually, without jumps).

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘OTPs don’t match with the ones provided by Google Authenticator’ is closed to new replies.