/dotnet-google-2fa

Demo for Google 2-Step Verification with ASP.NET Core and ReactJS

Primary LanguageJavaScript

Google 2FA with ASP.NET Core

HLD

google2fa.png

Sample UI

google2fa_lab.png

Test With PostMan

import Lab.TwoFA.postman_collection.json

  • GenerateSetupCode

    取得裝置設定碼, 格式參考 google-authenticator:Key Uri Format

    otpauth://TYPE/LABEL?PARAMETERS

  • GetCurrentPin

    取得當前有效的 PinCode

  • ValidatePin

    驗證傳入的 PinCode 是否有效

Data schema

User

  • id(pk, auto)
  • account(unique key)
  • password(hash+salt)
  • accountSecretKey(one time generate only)

References