TOTPClient

interface TOTPClient

TOTP (time-based one-time passcode) authentication methods.

Functions

Link copied to clipboard
abstract suspend fun authenticate(request: ITOTPsAuthenticateParameters): TOTPsAuthenticateResponse

Authenticates a time-based one-time passcode from the user's authenticator app. Calls the POST /sdk/v1/totps/authenticate endpoint.

Link copied to clipboard
abstract suspend fun create(request: ITOTPsCreateParameters): TOTPsCreateResponse

Creates a new TOTP instance for the current user and returns the secret, QR code URL, and recovery codes. Calls the POST /sdk/v1/totps endpoint. The user should scan the QR code with their authenticator app, then call authenticate to verify setup.

Link copied to clipboard
abstract suspend fun recover(request: ITOTPsRecoverParameters): TOTPsRecoverResponse

Authenticates the user with a TOTP recovery code instead of a time-based code. Calls the POST /sdk/v1/totps/recover endpoint. Each recovery code can only be used once.

Link copied to clipboard
abstract suspend fun recoveryCodes(): TOTPsGetRecoveryCodesResponse

Retrieves the recovery codes for the current user's TOTP instance. Calls the POST /sdk/v1/totps/recovery_codes endpoint. Requires an active session.