AuthenticationRequest


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).

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.

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.

Public companion functions

inline AuthenticationRequest.Biometric

Construct an instance of Biometric that includes a set of configurable options for how the biometric prompt should appear and behave with biometric authentication with fallbacks.

AuthenticationRequest.Credential

Construct an instance of Credential that includes a set of configurable options for how the prompt should appear and behave with device credential authentication.

Public companion functions

biometricRequest

Added in 1.4.0-alpha03
inline fun biometricRequest(
    title: String,
    authFallback: AuthenticationRequest.Biometric.Fallback,
    init: AuthenticationRequest.Biometric.Builder.() -> Unit
): AuthenticationRequest.Biometric

Construct an instance of Biometric that includes a set of configurable options for how the biometric prompt should appear and behave with biometric authentication with fallbacks.

credentialRequest

Added in 1.4.0-alpha03
@RequiresApi(value = 30)
fun credentialRequest(title: String, init: AuthenticationRequest.Credential.Builder.() -> Unit): AuthenticationRequest.Credential

Construct an instance of Credential that includes a set of configurable options for how the prompt should appear and behave with device credential authentication.