Biometrics

interface Biometrics

Biometrics interface that encompasses registration and authentication functions

Types

Link copied to clipboard
data class AuthenticateParameters(    val context: FragmentActivity,     val sessionDurationMinutes: UInt = Constants.DEFAULT_SESSION_TIME_MINUTES,     val promptInfo: BiometricPrompt.PromptInfo? = null)

Data class used for wrapping parameters used with Biometrics authentication flow

Link copied to clipboard
data class RegisterParameters(    val context: FragmentActivity,     val sessionDurationMinutes: UInt = Constants.DEFAULT_SESSION_TIME_MINUTES,     val allowFallbackToCleartext: Boolean = false,     val promptInfo: BiometricPrompt.PromptInfo? = null)

Data class used for wrapping parameters used with Biometrics registration flow

Functions

Link copied to clipboard
abstract fun areBiometricsAvailable(context: FragmentActivity): BiometricAvailability

Indicates if the biometric sensor is available, and provides a reasoning if not

Link copied to clipboard
abstract suspend fun authenticate(parameters: Biometrics.AuthenticateParameters): BiometricsAuthResponse
abstract fun authenticate(parameters: Biometrics.AuthenticateParameters, callback: (BiometricsAuthResponse) -> Unit)

If a valid biometric registration exists, this method confirms the current device owner via the device's built-in biometric reader and returns an updated session object by either starting a new session or adding the biometric factor to an existing session.

Link copied to clipboard
abstract fun isRegistrationAvailable(context: FragmentActivity): Boolean

Indicates if there is an existing biometric registration on device.

Link copied to clipboard
abstract fun isUsingKeystore(): Boolean

Indicates if the device is using the Android KeyStore

Link copied to clipboard
abstract suspend fun register(parameters: Biometrics.RegisterParameters): BiometricsAuthResponse
abstract fun register(parameters: Biometrics.RegisterParameters, callback: (BiometricsAuthResponse) -> Unit)

When a valid/active session exists, this method will add a biometric registration for the current user. The user will later be able to start a new session with biometrics or use biometrics as an additional authentication factor.

Link copied to clipboard
abstract suspend fun removeRegistration(): Boolean
abstract fun removeRegistration(callback: (Boolean) -> Unit)

Clears existing biometric registrations stored on device. Useful when removing a user from a given device.

Inheritors

Link copied to clipboard