AuthenticationRequest


public abstract class AuthenticationRequest

Known direct subclasses
AuthenticationRequest.Biometric

A set of configurable options for how the BiometricPrompt should appear and behave with biometric authentication with fallbacks.

AuthenticationRequest.Credential

A set of configurable options for how the BiometricPrompt should appear and behave with device credential only.


Types for configuring authentication prompt with options that are commonly used together. For example, to perform a basic biometric authentication request do:

val request = biometricRequest(
title = "title",
authFallback = BiometricRequest.Fallback.NegativeButton("cancel")
) {
setSubtitle("sub title")
setMinStrength(BiometricRequest.Strength.Class2)
}

to perform a basic credential authentication request do:

val request = credentialRequest(
title = "title",
) {
setSubtitle("sub title")
}

Backward Compatibility Notes:

  1. < API 30: Credential (device credential only) is not supported.

  2. < API 28: For Biometric.Strength.Class3 + Biometric.Fallback.DeviceCredential, Biometric.Strength.Class3.cryptoObject cannot be used

  3. API 28/29: Biometric.Strength.Class3 + Biometric.Fallback.DeviceCredential is not supported.

Summary

Nested types

A set of configurable options for how the BiometricPrompt should appear and behave with biometric authentication with fallbacks.

Builder used to create an instance of Biometric.

Fallback options for the biometric authentication.

Device credential as the fallback.

A customized negative button as the fallback.

Types of biometric strength for the prompt.

Class 2 (formerly Weak).

Class 3 (formerly Strong).

public abstract class AuthenticationRequest.BodyContent

Types of the body content to be displayed on the prompt.

A view with "more options" button.

Plain text description as body content.

A vertical list as body content.

@RequiresApi(value = 30)
public final class AuthenticationRequest.Credential extends AuthenticationRequest

A set of configurable options for how the BiometricPrompt should appear and behave with device credential only.

Builder used to create an instance of Credential.