Google is committed to advancing racial equity for Black communities. See how.

androidx.biometric.auth

Interfaces

AuthPrompt

A wrapper class for Class2BiometricAuthPrompt, Class3BiometricAuthPrompt Class2BiometricOrCredentialAuthPrompt, Class3BiometricOrCredentialAuthPrompt and CredentialAuthPrompt that allows for cancellation and dismissal of the current authentication prompt.

Classes

AuthPromptCallback

A collection of methods that may be invoked by Class2BiometricAuthPrompt, Class3BiometricAuthPrompt, Class2BiometricOrCredentialAuthPrompt, Class3BiometricOrCredentialAuthPrompt, or CredentialAuthPrompt during authentication, returning the androidx.fragment.app.FragmentActivity the prompt is attached to.

AuthPromptHost

A wrapper class for FragmentActivity and Fragment with the FragmentActivity or Fragment that hosts the AuthPrompt

Class2BiometricAuthPrompt

This class is used to build and configure a BiometricPrompt for authentication that only permits Class 2 biometric modalities (fingerprint, iris, face, etc), and then start authentication.

Class2BiometricOrCredentialAuthPrompt

This class is used to build and configure a BiometricPrompt for authentication that permits Class 2 biometric modalities (fingerprint, iris, face, etc), or device credential modalities (device PIN, pattern, or password), and then start authentication.

Class3BiometricAuthPrompt

This class is used to build and configure a BiometricPrompt for authentication that only permits Class 3 biometric modalities (fingerprint, iris, face, etc), and then start authentication.

Class3BiometricOrCredentialAuthPrompt

This class is used to build and configure a BiometricPrompt for authentication that permits Class 3 biometric modalities (fingerprint, iris, face, etc), or device credential modalities (device PIN, pattern, or password), and then start authentication.

CredentialAuthPrompt

This class is used to build and configure a BiometricPrompt for authentication that only permits device credential modalities (device PIN, pattern, or password), and then start authentication.

Extension functions summary

For FragmentActivity
AuthPrompt
FragmentActivity.startClass2BiometricAuthentication(title: CharSequence, negativeButtonText: CharSequence, subtitle: CharSequence? = null, description: CharSequence? = null, confirmationRequired: Boolean = true, executor: Executor? = null, callback: AuthPromptCallback)

Builds a Class2BiometricAuthPrompt hosted on the current FragmentActivity, which configures a BiometricPrompt for authentication via Class 2 biometric modalities (fingerprint, iris, face, etc) and begins authentication.

AuthPrompt
FragmentActivity.startClass2BiometricOrCredentialAuthentication(title: CharSequence, subtitle: CharSequence? = null, description: CharSequence? = null, confirmationRequired: Boolean = true, executor: Executor? = null, callback: AuthPromptCallback)

Builds a Class2BiometricOrCredentialAuthPrompt hosted on the current FragmentActivity, which configures a BiometricPrompt for authentication with Class 2 biometric modalities (fingerprint, iris, face, etc) or device credential modalities (device PIN, pattern, or password) and begins authentication.

AuthPrompt
FragmentActivity.startClass3BiometricAuthentication(crypto: BiometricPrompt.CryptoObject?, title: CharSequence, negativeButtonText: CharSequence, subtitle: CharSequence? = null, description: CharSequence? = null, confirmationRequired: Boolean = true, executor: Executor? = null, callback: AuthPromptCallback)

Builds a Class3BiometricAuthPrompt hosted on the current FragmentActivity, which configures a BiometricPrompt for authentication with Class 3 biometric modalities (fingerprint, iris, face, etc) and begins authentication.

AuthPrompt
FragmentActivity.startClass3BiometricOrCredentialAuthentication(crypto: BiometricPrompt.CryptoObject?, title: CharSequence, subtitle: CharSequence? = null, description: CharSequence? = null, confirmationRequired: Boolean = true, executor: Executor? = null, callback: AuthPromptCallback)

Builds a Class3BiometricOrCredentialAuthPrompt hosted on the current FragmentActivity, which configures a BiometricPrompt for authentication with Class 3 biometric modalities (fingerprint, iris, face, etc) or device credential modalities (device PIN, pattern, or password) and begins authentication.

AuthPrompt
FragmentActivity.startCredentialAuthentication(crypto: BiometricPrompt.CryptoObject?, title: CharSequence, description: CharSequence? = null, executor: Executor? = null, callback: AuthPromptCallback)

Builds a CredentialAuthPrompt hosted on the current FragmentActivity, which configures a BiometricPrompt for authentication with device credential modalities (device PIN, pattern, or password) and begins authentication.

For Fragment
AuthPrompt
Fragment.startClass2BiometricAuthentication(title: CharSequence, negativeButtonText: CharSequence, subtitle: CharSequence? = null, description: CharSequence? = null, confirmationRequired: Boolean = true, executor: Executor? = null, callback: AuthPromptCallback)

Builds a Class2BiometricAuthPrompt hosted on the current Fragment, which configures a BiometricPrompt for authentication with Class 2 biometric modalities (fingerprint, iris, face, etc) and begins authentication.

AuthPrompt
Fragment.startClass2BiometricOrCredentialAuthentication(title: CharSequence, subtitle: CharSequence? = null, description: CharSequence? = null, confirmationRequired: Boolean = true, executor: Executor? = null, callback: AuthPromptCallback)

Builds a Class2BiometricOrCredentialAuthPrompt hosted on the current Fragment, which configures a BiometricPrompt for authentication with Class 2 biometric modalities (fingerprint, iris, face, etc) or device credential modalities (device PIN, pattern, or password) and begins authentication.

AuthPrompt