Class2BiometricOrCredentialAuthPrompt

public class Class2BiometricOrCredentialAuthPrompt
extends Object

java.lang.Object
   ↳ androidx.biometric.auth.Class2BiometricOrCredentialAuthPrompt


An authentication prompt that requires the user to present a Class 2 biometric (e.g. fingerprint, face, or iris) or the screen lock credential (i.e. PIN, pattern, or password) for the device.

Note that Class 3 biometrics are guaranteed to meet the requirements for Class 2 and thus will also be accepted.

Summary

Nested classes

class Class2BiometricOrCredentialAuthPrompt.Builder

Builder for a Class2BiometricOrCredentialAuthPrompt with configurable options. 

Public methods

CharSequence getDescription()

Gets the description to be displayed on the prompt, if set.

CharSequence getSubtitle()

Gets the subtitle to be displayed on the prompt, if set.

CharSequence getTitle()

Gets the title to be displayed on the prompt.

boolean isConfirmationRequired()

Checks if the prompt should require explicit user confirmation after a passive biometric (e.g.

AuthPrompt startAuthentication(AuthPromptHost host, Executor executor, AuthPromptCallback callback)

Shows an authentication prompt to the user.

AuthPrompt startAuthentication(AuthPromptHost host, AuthPromptCallback callback)

Shows an authentication prompt to the user.

Inherited methods

Public methods

getDescription

public CharSequence getDescription ()

Gets the description to be displayed on the prompt, if set.

Returns
CharSequence The description for the prompt.

getSubtitle

public CharSequence getSubtitle ()

Gets the subtitle to be displayed on the prompt, if set.

Returns
CharSequence The subtitle for the prompt.

getTitle

public CharSequence getTitle ()

Gets the title to be displayed on the prompt.

Returns
CharSequence The title for the prompt.

isConfirmationRequired

public boolean isConfirmationRequired ()

Checks if the prompt should require 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 the prompt should require explicit user confirmation for passive biometrics.

startAuthentication

public AuthPrompt startAuthentication (AuthPromptHost host, 
                Executor executor, 
                AuthPromptCallback callback)

Shows an authentication prompt to the user.

Parameters
host AuthPromptHost: A wrapper for the component that will host the prompt.

executor Executor: The executor that will be used to run authentication callback methods.

callback AuthPromptCallback: The callback object that will receive and process authentication events.

Returns
AuthPrompt A handle to the shown prompt.

startAuthentication

public AuthPrompt startAuthentication (AuthPromptHost host, 
                AuthPromptCallback callback)

Shows an authentication prompt to the user.

Parameters
host AuthPromptHost: A wrapper for the component that will host the prompt.

callback AuthPromptCallback: The callback object that will receive and process authentication events. Each callback method will be run on the main thread.

Returns
AuthPrompt A handle to the shown prompt.