Working of Authenticator app

How Google/Microsoft Authenticator works