Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TotpTwoFactorAuthStrategy<Account>

Two factor authentication strategy which uses TOTP mechanism.
When 2fa is enabled, the strategy will generate a secret, which will be sent to client as QR Image Code (see OnTwoFactorEnabledHookResult.totpSecretQRImageUrl). Client has to scan this image with his Authenticator App.
During authentication process, when client will receive AuthenticationStepName.TWO_FACTOR_AUTH_CHECK as AuthenticationStatus.nextStep, he needs to send back 2fa token generated by his app to complete authentication.

Type parameters

Hierarchy

  • TotpTwoFactorAuthStrategy

Implements

Constructors

constructor

Methods

isAuthenticationTokenValid

  • isAuthenticationTokenValid(account: Account, authenticationContext: AuthenticationContext, authenticationSessionRepositoryHolder: AuthenticationSessionRepositoryHolder): Promise<boolean>

onTwoFactorAuthEnabled

sendAuthenticationToken

  • sendAuthenticationToken(account: AccountModel, _authenticationContext: AuthenticationContext, authenticationSessionRepositoryHolder: AuthenticationSessionRepositoryHolder): Promise<void>