TOTP

interface TOTP

The TOTP interface provides methods for creating and authenticating TOTP codes; retrieving recovery codes; and consuming a recovery code

Types

Link copied to clipboard
data class AuthenticateParameters @JvmOverloads constructor(val totpCode: String, val sessionDurationMinutes: Int = 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 @JvmOverloads constructor(val recoveryCode: String, val sessionDurationMinutes: Int = 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

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

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

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.

Link copied to clipboard

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