BiometricPromptData
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.
| Throws | |
|---|---|
kotlin.IllegalArgumentException |
if |
| See also | |
|---|---|
BiometricManager.Authenticators |
Summary
Nested types |
|---|
public final class BiometricPromptData.BuilderBuilder for constructing an instance of |
Public constructors |
|---|
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. |
Public methods |
|
|---|---|
final int |
specifies the type(s) of authenticators that may be invoked by the |
final BiometricPrompt.CryptoObject |
a crypto object to be unlocked after successful authentication; When set, the value of |
Public constructors
BiometricPromptData
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 |
int allowedAuthenticators |
specifies the type(s) of authenticators that may be invoked by the |
| Throws | |
|---|---|
kotlin.IllegalArgumentException |
if |
| See also | |
|---|---|
BiometricManager.Authenticators |
Public methods
getAllowedAuthenticators
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
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