4 min read

How to Generate QR Codes for 2FA Authenticator Apps (Google & Microsoft)

Two-Factor Authentication (2FA) apps use standard Time-Based One-Time Password (TOTP) QR codes to pair mobile authenticators with web services.

The OTPAuth URI Standard

otpauth://totp/ExampleService:user@email.com?secret=JBSWY3DPEHPK3PXP&issuer=ExampleService&algorithm=SHA1&digits=6&period=30

When scanned by Google Authenticator or Microsoft Authenticator, the app stores the shared secret key and computes rotating 6-digit verification codes every 30 seconds.