BiometricPromptData


@RequiresApi(value = 35)
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

Builder for constructing an instance of BiometricPromptData

Public constructors

BiometricPromptData(
    cryptoObject: BiometricPrompt.CryptoObject?,
    allowedAuthenticators: Int
)

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 properties

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

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
BiometricPromptData(
    cryptoObject: BiometricPrompt.CryptoObject? = null,
    allowedAuthenticators: Int = BIOMETRIC_WEAK
)

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
cryptoObject: BiometricPrompt.CryptoObject? = null

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

allowedAuthenticators: Int = BIOMETRIC_WEAK

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 properties

allowedAuthenticators

Added in 1.5.0-beta01
val allowedAuthenticatorsInt

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

cryptoObject

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