So we have the need for using a TOTP to generate a code on the server to send to a mobile client, I have been testing code generation with the following 3 java repos:
I've taken the core TOTP generating code and I've been testing them. My issue is that I will run the arbitrary mvn unit test where using the default time step of 30 secs, I will generate a token (t0), wait 2 seconds, and generate another token (t1) and sometimes (like 1 of every 10 tries) t0 != t1. I can't figure out why this is and my math-fu is not at the level to fully grasp whether this is expected or whether I am doing something wrong.
Note that this happens for all the 3 code sources (i haven't changed the code except for providing the secret key) I mentioned above - clearly either i'm doing something wrong or this behavior is possibly expected?!