AuthenticationRequest
abstract class AuthenticationRequest
AuthenticationRequest.Biometric |
A set of configurable options for how the |
AuthenticationRequest.Credential |
A set of configurable options for how the |
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:
-
< API 30:
Credential(device credential only) is not supported. -
< API 28: For
Biometric.Strength.Class3+Biometric.Fallback.DeviceCredential,Biometric.Strength.Class3.cryptoObjectcannot be used -
API 28/29:
Biometric.Strength.Class3+Biometric.Fallback.DeviceCredentialis not supported.
Summary
Nested types |
|---|
|
A set of configurable options for how the |
|
Builder used to create an instance of |
abstract class AuthenticationRequest.Biometric.FallbackFallback options for the biometric authentication. |
object AuthenticationRequest.Biometric.Fallback.DeviceCredential : AuthenticationRequest.Biometric.FallbackDevice credential as the fallback. |
class AuthenticationRequest.Biometric.Fallback.NegativeButton : AuthenticationRequest.Biometric.FallbackA customized negative button as the fallback. |
abstract class AuthenticationRequest.Biometric.StrengthTypes of biometric strength for the prompt. |
|
Class 2 (formerly Weak). |
|
Class 3 (formerly Strong). |
abstract class AuthenticationRequest.BodyContentTypes of the body content to be displayed on the prompt. |
class AuthenticationRequest.BodyContent.ContentViewWithMoreOptionsButton : AuthenticationRequest.BodyContentA view with "more options" button. |
|
Plain text description as body content. |
|
A vertical list as body content. |
@RequiresApi(value = 30)A set of configurable options for how the |
|
Builder used to create an instance of |
Public companion functions |
|
|---|---|
inline AuthenticationRequest.Biometric |
biometricRequest(Construct an instance of |
AuthenticationRequest.Credential |
@RequiresApi(value = 30)Construct an instance of |
Public companion functions
biometricRequest
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
@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.