OTP

interface OTP

The OTP interface provides methods for sending and authenticating One-Time Passcodes (OTP) via SMS, WhatsApp, and Email.

Types

Link copied to clipboard
data class AuthParameters(val token: String, val methodId: String, val sessionDurationMinutes: UInt = DEFAULT_SESSION_TIME_MINUTES)

Data class used for wrapping parameters used with OTP authentication

Link copied to clipboard
interface EmailOTP

Provides all possible ways to call Email OTP endpoints

Link copied to clipboard
interface SmsOTP

Provides all possible ways to call SMS OTP endpoints

Link copied to clipboard
interface WhatsAppOTP

Provides all possible ways to call WhatsApp OTP endpoints

Properties

Link copied to clipboard
abstract val email: OTP.EmailOTP

Public variable that exposes an instance of Email OTP

Link copied to clipboard
abstract val sms: OTP.SmsOTP

Public variable that exposes an instance of SMS OTP

Link copied to clipboard

Public variable that exposes an instance of WhatsApp OTP

Functions

Link copied to clipboard
abstract suspend fun authenticate(parameters: OTP.AuthParameters): AuthResponse
abstract fun authenticate(parameters: OTP.AuthParameters, callback: (AuthResponse) -> Unit)

Authenticate a user given a method_id (the associated email_id or phone_id) and a code. This endpoint verifies that the code is valid, hasn't expired or been previously used. A given method_id may only have a single active OTP code at any given time, if a user requests another OTP code before the first one has expired, the first one will be invalidated.