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

Class2BiometricAuthPrompt

public class Class2BiometricAuthPrompt
extends Object

java.lang.Object
   ↳ 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

class Class2BiometricAuthPrompt.Builder

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

Public methods

CharSequence getDescription()

Gets the description for the prompt.

CharSequence getSubtitle()

Gets the subtitle for the prompt.

boolean isConfirmationRequired()

Indicates whether prompt requires explicit user confirmation after a passive biometric (e .g.

AuthPrompt startAuthentication()

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

Inherited methods

Public methods

getDescription

public CharSequence getDescription ()

Gets the description for the prompt. Defaults to null.

Returns
CharSequence description for the prompt

getSubtitle

public CharSequence getSubtitle ()

Gets the subtitle for the prompt.

Returns
CharSequence subtitle for the prompt

isConfirmationRequired

public boolean isConfirmationRequired ()

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.

Returns
boolean whether prompt requires explicit user confirmation after a passive biometric.

startAuthentication

public AuthPrompt startAuthentication ()

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

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