How Authenticator Apps Generate the Same OTP on Authenticator APP as Your Server Without Any Communication between them
One of the most common questions developers ask when learning Multi-Factor Authentication (MFA) is:
How does my server generate the exact same OTP as an authenticator app like Google Authenticator without sending anything to it?
At first, this seems confusing.
You might assume one of these things happens:
The server sends the OTP to the authenticator app
The authenticator app requests the OTP from the server
The server and app somehow communicate in real time
But none of these are true.
The real answer is much more interesting.
The Core Concept
There is no communication between your server and authenticator app during login.
Your server does NOT send OTP to the authenticator app.
Your authenticator app does NOT ask your server for OTP.
Instead, both generate the same OTP independently using mathematics.
This system is called:
Time-Based One-Time Password (TOTP)
It is…