BiometricPromptData.Builder


public final class BiometricPromptData.Builder


Builder for constructing an instance of BiometricPromptData

Summary

Public constructors

Public methods

final @NonNull BiometricPromptData

Builds the BiometricPromptData instance.

final @NonNull BiometricPromptData.Builder
setAllowedAuthenticators(int allowedAuthenticators)

Specifies the type(s) of authenticators that may be invoked to authenticate the user.

final @NonNull BiometricPromptData.Builder

Sets whether this BiometricPromptData should have a crypto object associated with this authentication.

Public constructors

Builder

Added in 1.5.0-beta01
public Builder()

Public methods

build

Added in 1.5.0-beta01
public final @NonNull BiometricPromptData build()

Builds the BiometricPromptData instance.

setAllowedAuthenticators

Added in 1.5.0-beta01
public final @NonNull BiometricPromptData.Builder setAllowedAuthenticators(int allowedAuthenticators)

Specifies the type(s) of authenticators that may be invoked to authenticate the user. Available authenticator types are defined in Authenticators and can be combined via bitwise OR. Defaults to BIOMETRIC_WEAK.

If this method is used and no authenticator of any of the specified types is available at the time an error code will be supplied as part of android.content.Intent that will be launched by the containing CredentialEntry or CreateEntry's corresponding android.app.PendingIntent.

Parameters
int allowedAuthenticators

A bit field representing all valid authenticator types that may be invoked by the Credential Manager selector.

setCryptoObject

Added in 1.5.0-beta01
public final @NonNull BiometricPromptData.Builder setCryptoObject(BiometricPrompt.CryptoObject cryptoObject)

Sets whether this BiometricPromptData should have a crypto object associated with this authentication. If opting to pass in a value, the allowedAuthenticators must be BIOMETRIC_STRONG. 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

the CryptoObject to be associated with this biometric authentication flow