Google is committed to advancing racial equity for Black communities. See how.

Class2BiometricAuthPrompt

open class Class2BiometricAuthPrompt
kotlin.Any
   ↳ androidx.biometric.auth.Class2BiometricAuthPrompt

This class is used to build and configure a BiometricPrompt for authentication that only permits Class 2 biometric modalities (fingerprint, iris, face, etc), and then start authentication. Class 2 (formerly known as Weak) refers to the strength of the biometric sensor, as specified in the Android 11 CDD. Class 2 authentication can be used for applications that don't require cryptographic operations.

Summary

Nested classes

Builds a BiometricPrompt object for Class 2 biometric only authentication with specified options.

Public methods
open CharSequence?

Gets the description for the prompt.

open CharSequence?

Gets the subtitle for the prompt.

open Boolean

Indicates whether prompt requires explicit user confirmation after a passive biometric (e .g. iris or face) has been recognized but before

open AuthPrompt

Begins authentication using the configured biometric prompt, and returns an AuthPrompt wrapper that can be used for cancellation and dismissal of the biometric prompt.

Public methods

getDescription

@Nullable open fun getDescription(): CharSequence?

Gets the description for the prompt. Defaults to null.

Return
CharSequence? description for the prompt

getSubtitle

@Nullable open fun getSubtitle(): CharSequence?

Gets the subtitle for the prompt.

Return
CharSequence? subtitle for the prompt

isConfirmationRequired

open fun isConfirmationRequired(): Boolean

Indicates whether prompt requires explicit user confirmation after a passive biometric (e .g. iris or face) has been recognized but before AuthPromptCallback#onAuthenticationSucceeded(androidx.fragment.app.FragmentActivity, * BiometricPrompt.AuthenticationResult) is called.

Return
Boolean whether prompt requires explicit user confirmation after a passive biometric.

startAuthentication

@NonNull open fun startAuthentication(): AuthPrompt

Begins authentication using the configured biometric prompt, and returns an AuthPrompt wrapper that can be used for cancellation and dismissal of the biometric prompt.

Return
AuthPrompt AuthPrompt wrapper that can be used for cancellation and dismissal of the biometric prompt using AuthPrompt#cancelAuthentication()