Two factor auth consistently returns invalid authentication code

I recently had the same issue on a forum I host, and in the end I figured out that it occurred because my server time was slightly off. Try comparing the time of your server (including seconds) to network time (e.g. via time.is), and if it’s different make sure that your system is configured to sync its clock across the network (using something like systemd-timesyncd or ntpd, if you’re on Linux). For me that did the trick.

5 Likes