Expand description
Server-side TOTP, backup-code, and QR-code helpers.
Enums§
- TwoFactor
Server Error - Error states returned by server-side two-factor helpers.
Functions§
- build_
backup_ codes - Generates a batch of randomized backup codes.
- build_
totp_ secret - Generates a new TOTP secret and OTPAUTH URI for the account identifier.
- build_
totp_ uri_ from_ secret - Builds an OTPAUTH URI for an existing Base32 TOTP secret.
- render_
qr_ artifacts - Renders QR code artifacts for the provided OTPAUTH URI.
- verify_
totp_ step - Returns the matching TOTP timestep at the current system time. The application must consume this step durably before granting access.
- verify_
totp_ step_ at - Returns the matching timestep for a supplied timestamp. Only the current 30-second step is accepted. No drift window is added.