AuthenticationRequest.Companion


public static class AuthenticationRequest.Companion


Summary

Public methods

static final @NonNull 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.

static final @NonNull AuthenticationRequest.Credential
@RequiresApi(value = 30)
credentialRequest(
    @NonNull String title,
    @NonNull Function1<@NonNull AuthenticationRequest.Credential.BuilderUnit> init
)

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 methods

biometricRequest

public static final @NonNull AuthenticationRequest.Biometric biometricRequest(
    @NonNull String title,
    @NonNull AuthenticationRequest.Biometric.Fallback... authFallbacks,
    @NonNull Function1<@NonNull AuthenticationRequest.Biometric.BuilderUnit> init
)

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.

Note for Java users: This method is intended for use in Kotlin. For Java, please use Biometric.Builder instead.

Parameters
@NonNull String title

The title of the prompt.

@NonNull AuthenticationRequest.Biometric.Fallback... authFallbacks

A list of Biometric.Fallback options (up to Biometric.getMaxFallbackOptions). If empty, a default "Cancel" button is used; If one option is provided, it is displayed as the negative button on the primary authentication screen. If multiple options are provided, these are displayed as a list on a separate fallback options page.

@NonNull Function1<@NonNull AuthenticationRequest.Biometric.BuilderUnit> init

A block to configure the Biometric instance.

Throws
IllegalArgumentException

if more than one Biometric.Fallback.DeviceCredential is provided, or if the total number of fallbacks exceeds Biometric.getMaxFallbackOptions.

Compatibility Note: Prior to Build.VERSION_CODES_FULL.BAKLAVA_1 (API 36.1), only one fallback option is supported. If multiple options are provided on earlier Android versions, only the first fallback will be displayed as the negative button (without an icon), and the remaining fallbacks will be ignored.

credentialRequest

Added in 1.4.0-alpha06
@RequiresApi(value = 30)
public static final @NonNull AuthenticationRequest.Credential credentialRequest(
    @NonNull String title,
    @NonNull Function1<@NonNull AuthenticationRequest.Credential.BuilderUnit> init
)

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

Note for Java users: This method is intended for use in Kotlin. For Java, please use Credential.Builder instead.