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.

Finally, note that the CryptoObject does not presently support presentationSession and operationHandle constructors, and intends to support the CryptoObject built from the stable biometric jetpack library described here.

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, note that the CryptoObject does not presently support presentationSession and operationHandle constructors, and intends to support the CryptoObject built from the stable biometric jetpack library described here

Public constructors

BiometricPromptData

Added in 1.5.0-beta01
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.

Finally, note that the CryptoObject does not presently support presentationSession and operationHandle constructors, and intends to support the CryptoObject built from the stable biometric jetpack library described here.

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, note that the CryptoObject does not presently support presentationSession and operationHandle constructors, and intends to support the CryptoObject built from the stable biometric jetpack library described here

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-beta01
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-beta01
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, note that the CryptoObject does not presently support presentationSession and operationHandle constructors, and intends to support the CryptoObject built from the stable biometric jetpack library described here