BiometricPrompt.Builder.SetAllowedAuthenticators(Int32) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Optional: Specifies the type(s) of authenticators that may be invoked by BiometricPrompt to authenticate the user.
[Android.Runtime.Register("setAllowedAuthenticators", "(I)Landroid/hardware/biometrics/BiometricPrompt$Builder;", "GetSetAllowedAuthenticators_IHandler", ApiSince=30)]
public virtual Android.Hardware.Biometrics.BiometricPrompt.Builder SetAllowedAuthenticators(int authenticators);
[<Android.Runtime.Register("setAllowedAuthenticators", "(I)Landroid/hardware/biometrics/BiometricPrompt$Builder;", "GetSetAllowedAuthenticators_IHandler", ApiSince=30)>]
abstract member SetAllowedAuthenticators : int -> Android.Hardware.Biometrics.BiometricPrompt.Builder
override this.SetAllowedAuthenticators : int -> Android.Hardware.Biometrics.BiometricPrompt.Builder
Parameters
- authenticators
- Int32
A bit field representing all valid authenticator types that may be invoked by the prompt. Value is either 0 or a combination of the following: BiometricManager.Authenticators.BIOMETRIC_STRONG; BiometricManager.Authenticators.BIOMETRIC_WEAK; BiometricManager.Authenticators.DEVICE_CREDENTIAL; BiometricManager.Authenticators.IDENTITY_CHECK
Returns
This builder. This value cannot be null.
- Attributes
Remarks
Optional: Specifies the type(s) of authenticators that may be invoked by BiometricPrompt to authenticate the user. Available authenticator types are defined in Authenticators and can be combined via bitwise OR. Defaults to: Authenticators.BIOMETRIC_WEAK for non-crypto authentication, or Authenticators.BIOMETRIC_STRONG for crypto-based authentication.
If this method is used and no authenticator of any of the specified types is available at the time BiometricPrompt#authenticate(...) is called, authentication will be canceled and AuthenticationCallback.onAuthenticationError(int,CharSequence) will be invoked with an appropriate error code.
This method should be preferred over setDeviceCredentialAllowed(boolean) and overrides the latter if both are used. Using this method to enable device credential authentication (with Authenticators.DEVICE_CREDENTIAL) will replace the negative button on the prompt, making it an error to also call setNegativeButton(CharSequence,Executor,DialogInterface.OnClickListener).
If unlocking cryptographic operation(s), it is the application's responsibility to request authentication with the proper set of authenticators (e.g. match the authenticators specified during key generation).
Android reference for android.hardware.biometrics.BiometricPrompt.Builder.setAllowedAuthenticators.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.