Skip to main content

Module two_factor

Module two_factor 

Source
Expand description

Two-factor authentication: the callback the caller implements and the TOTP exchange that drives it.

Only TOTP (Google Authenticator) is implemented. WebAuthn and Duo extend TwoFactorUi later.

Enumsยง

MfaOutcome ๐Ÿ”’
The result of submitting a second factor: verified, or a rejected code that asks for a restart.
TotpResult
The outcome of a two-factor prompt.

Constantsยง

MFA_ENDPOINT ๐Ÿ”’

Traitsยง

TwoFactorUi
Callback for interactive two-factor authentication.

Functionsยง

perform_second_factor_authentication ๐Ÿ”’
Prompts for and submits a TOTP code. WebAuthn and Duo are not supported yet.
submit_totp ๐Ÿ”’
Submits a TOTP code to v1/auth/mfa. The remember-me token in the response is ignored (one-shot import).