OathClient

Implementation of OathClient that provides OATH functionality. This client handles TOTP and HOTP credential management and code generation.

Parameters

configuration

The OATH configuration.

storage

The OathStorage implementation to use. If null, a default SQLOathStorage will be created.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard

Creates an OATH Credential from a standard otpauth:// URI (typically from a QR code).

Link copied to clipboard
open suspend override fun close()

Clean up resources used by the OATH client. This method clears caches and then calls the parent close method.

Link copied to clipboard
suspend fun deleteCredential(credentialId: String): Result<Boolean>

Delete an OATH credential by ID.

Link copied to clipboard
suspend fun generateCode(credentialId: String): Result<String>

Generate an OTP code for an OATH credential.

Link copied to clipboard
suspend fun generateCodeWithValidity(credentialId: String): Result<OathCodeInfo>

Generate an OTP code for an OATH credential and get its time validity information.

Link copied to clipboard
suspend fun getCredential(credentialId: String): Result<OathCredential?>

Get an OATH credential by ID.

Link copied to clipboard

Get all OATH credentials.

Link copied to clipboard
protected open suspend override fun initializeClient()

Initialize the OATH client.

Link copied to clipboard

Save an OATH credential.