A practical guide to implementing TOTP-based Two-Factor Authentication in ASP.NET Core. Covers how TOTP works, generating cryptographically secure secret keys with Otp.NET, creating QR codes using QRCoder, the correct two-step setup flow (pending → confirmed), issuing limited-scope tokens during login, validating codes with

13m read time From milanjovanovic.tech
Post cover image
Table of contents
How TOTP WorksGenerating the Secret KeyCreating the QR CodeThe Setup FlowThe Login Flow With 2FAValidating TOTP CodesEncrypting Secrets at RestRecovery CodesPutting It All TogetherSummary

Sort: