TOTP

interface TOTP

Types

Link copied to clipboard
data class AuthenticateParameters(val totpCode: String, val sessionDurationMinutes: UInt = Constants.DEFAULT_SESSION_TIME_MINUTES)

A data class wrapping the parameters use in a TOTP authenticate request

Link copied to clipboard
data class CreateParameters(val expirationMinutes: Int)

A data class wrapping the parameters used in a TOTP create request

Link copied to clipboard
data class RecoverParameters(val recoveryCode: String, val sessionDurationMinutes: UInt = Constants.DEFAULT_SESSION_TIME_MINUTES)

A data class wrapping the parameters use in a TOTP recover request

Functions

Link copied to clipboard
abstract fun authenticate(parameters: TOTP.AuthenticateParameters, callback: (TOTPAuthenticateResponse) -> Unit)

Call this method to authenticate a TOTP code entered by a user. If this method succeeds, the user will be logged in and granted an active session

Link copied to clipboard
abstract suspend fun create(parameters: TOTP.CreateParameters): TOTPCreateResponse
abstract fun create(parameters: TOTP.CreateParameters, callback: (TOTPCreateResponse) -> Unit)

Call this method to create a new TOTP instance for a user. The user can use the authenticator application of their choice to scan the QR code or enter the secret.

Link copied to clipboard
abstract suspend fun recover(parameters: TOTP.RecoverParameters): TOTPRecoverResponse
abstract fun recover(parameters: TOTP.RecoverParameters, callback: (TOTPRecoverResponse) -> Unit)

Call this method to authenticate a recovery code for a TOTP instance. If this method succeeds, the user will be logged in and granted an active session

Link copied to clipboard
abstract fun recoveryCodes(callback: (TOTPRecoveryCodesResponse) -> Unit)

Call this method to retrieve the recovery codes for a TOTP instance tied to a user.