BiometricPromptData


@RequiresApi(value = 35)
public final class BiometricPromptData


Biometric prompt data that can be optionally used to provide information needed for the system to show a biometric prompt directly embedded into the Credential Manager selector.

If you opt to use this, the meta-data provided through the CreateEntry or CredentialEntry will be shown along with a biometric / device credential capture mechanism, on a single dialog, hence avoiding navigation through multiple screens. When user confirmation is retrieved through the aforementioned biometric / device capture mechanism, the android.app.PendingIntent associated with the entry is invoked, and the flow continues as explained in CreateEntry or CredentialEntry.

Note that the value of allowedAuthenticators together with the features of a given device, determines whether a biometric auth or a device credential mechanism will / can be shown. The value for this property is found in Authenticators.

Summary

Nested types

public final class BiometricPromptData.Builder

Builder for constructing an instance of BiometricPromptData

Public constructors

BiometricPromptData(
    BiometricPrompt.CryptoObject cryptoObject,
    int allowedAuthenticators
)

Biometric prompt data that can be optionally used to provide information needed for the system to show a biometric prompt directly embedded into the Credential Manager selector.

Public methods

final int

specifies the type(s) of authenticators that may be invoked by the BiometricPrompt to authenticate the user, defaults to BIOMETRIC_WEAK if not set

final BiometricPrompt.CryptoObject

a crypto object to be unlocked after successful authentication; When set, the value of allowedAuthenticators must be BIOMETRIC_STRONG or else an IllegalArgumentException is thrown

Public constructors

BiometricPromptData

Added in 1.5.0-alpha02
public BiometricPromptData(
    BiometricPrompt.CryptoObject cryptoObject,
    int allowedAuthenticators
)

Biometric prompt data that can be optionally used to provide information needed for the system to show a biometric prompt directly embedded into the Credential Manager selector.

If you opt to use this, the meta-data provided through the CreateEntry or CredentialEntry will be shown along with a biometric / device credential capture mechanism, on a single dialog, hence avoiding navigation through multiple screens. When user confirmation is retrieved through the aforementioned biometric / device capture mechanism, the android.app.PendingIntent associated with the entry is invoked, and the flow continues as explained in CreateEntry or CredentialEntry.

Note that the value of allowedAuthenticators together with the features of a given device, determines whether a biometric auth or a device credential mechanism will / can be shown. The value for this property is found in Authenticators.

Parameters
BiometricPrompt.CryptoObject cryptoObject

a crypto object to be unlocked after successful authentication; When set, the value of allowedAuthenticators must be BIOMETRIC_STRONG or else an IllegalArgumentException is thrown

int allowedAuthenticators

specifies the type(s) of authenticators that may be invoked by the BiometricPrompt to authenticate the user, defaults to BIOMETRIC_WEAK if not set

Public methods

getAllowedAuthenticators

Added in 1.5.0-alpha02
public final int getAllowedAuthenticators()

specifies the type(s) of authenticators that may be invoked by the BiometricPrompt to authenticate the user, defaults to BIOMETRIC_WEAK if not set

getCryptoObject

Added in 1.5.0-alpha02
public final BiometricPrompt.CryptoObject getCryptoObject()

a crypto object to be unlocked after successful authentication; When set, the value of allowedAuthenticators must be BIOMETRIC_STRONG or else an IllegalArgumentException is thrown