# AuthenticationRequest

Artifact: [androidx.biometric:biometric](https://developer.android.com/jetpack/androidx/releases/biometric) [View Source](https://cs.android.com/search?q=file:androidx/biometric/AuthenticationRequest.kt+class:androidx.biometric.AuthenticationRequest) Added in [1.4.0-beta01](https://developer.android.com/jetpack/androidx/releases/biometric#1.4.0-beta01)

*** ** * ** ***


```
public abstract class AuthenticationRequest
```

<br />

Known direct subclasses [AuthenticationRequest.Biometric](https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric), [AuthenticationRequest.Credential](https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Credential)

|---|---|
| `https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric` | A set of configurable options for how the `https://developer.android.com/reference/androidx/biometric/BiometricPrompt` should appear and behave with biometric authentication with fallbacks. |
| `https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Credential` | A set of configurable options for how the `https://developer.android.com/reference/androidx/biometric/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",
    Biometric.Fallback.CustomOption("cancel")
) {
    setSubtitle("sub title")
    setMinStrength(Biometric.Strength.Class2)
}
```

to perform a basic credential authentication request do:

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

Backward Compatibility Notes:

1. \< API 30: `https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Credential` (device credential only) is not supported.

2. \< API 28: For `https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Strength.Class3` + `https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Fallback.DeviceCredential`, `https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Strength.Class3#cryptoObject()` cannot be used

3. API 28/29: `https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Strength.Class3` + `https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Fallback.DeviceCredential` is not supported.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric extends https://developer.android.com/reference/androidx/biometric/AuthenticationRequest` A set of configurable options for how the `https://developer.android.com/reference/androidx/biometric/BiometricPrompt` should appear and behave with biometric authentication with fallbacks. |
| `public final class https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Builder` Builder used to create an instance of `https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric`. |
| `public abstract class https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Fallback` Fallback options for the biometric authentication. |
| `public final class https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Fallback.CustomOption extends https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Fallback` Custom Fallback option displayed as the negative button in prompt authentication screen if it is the only option or displayed in a list in the fallback options page if there are more than one. |
| `public static class https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Fallback.DeviceCredential extends https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Fallback` Device credential as the fallback. |
| `public abstract class https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Strength` Types of biometric strength for the prompt. |
| `public static class https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Strength.Class2 extends https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Strength` Class 2 (formerly Weak). |
| `public final class https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Strength.Class3 extends https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Strength` Class 3 (formerly Strong). |
| `public abstract class https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.BodyContent` Types of the body content to be displayed on the prompt. |
| `public final class https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.BodyContent.ContentViewWithMoreOptionsButton extends https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.BodyContent` A view with "more options" button. |
| `public final class https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.BodyContent.PlainText extends https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.BodyContent` Plain text description as body content. |
| `public final class https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.BodyContent.VerticalList extends https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.BodyContent` A vertical list as body content. |
| `public static class https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Companion` |
| `@https://developer.android.com/reference/androidx/annotation/RequiresApi(value = 30) public final class https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Credential extends https://developer.android.com/reference/androidx/biometric/AuthenticationRequest` A set of configurable options for how the `https://developer.android.com/reference/androidx/biometric/BiometricPrompt` should appear and behave with device credential only. |
| `public final class https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Credential.Builder` Builder used to create an instance of `https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Credential`. |