# AuthenticationRequest.Biometric.Builder

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.Biometric.Builder) Added in [1.4.0-beta01](https://developer.android.com/jetpack/androidx/releases/biometric#1.4.0-beta01)

*** ** * ** ***


```
public final class AuthenticationRequest.Biometric.Builder
```

<br />

*** ** * ** ***

Builder used to create an instance of `https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric`.

**Note for Kotlin users:** Prefer using the `https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Companion#biometricRequest(kotlin.String,kotlin.Array,kotlin.Function1)` function to construct `https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric` instances.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if more than one `https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Fallback.DeviceCredential` is provided, or if the total number of fallbacks exceeds `https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.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. |

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Builder#Builder(kotlin.String,kotlin.Array)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html title, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Fallback... authFallbacks )` |

| ### Public methods |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric` | `https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Builder#build()()` Construct an instance of `https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric`. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Builder` | `https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Builder#setContent(androidx.biometric.AuthenticationRequest.BodyContent)(https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.BodyContent content)` The optional `https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.BodyContent` of the prompt. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Builder` | `https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Builder#setIsConfirmationRequired(kotlin.Boolean)(boolean isConfirmationRequired)` Whether user confirmation should be required for passive biometrics. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Builder` | `@https://developer.android.com/reference/androidx/annotation/RequiresPermission(value = "android.permission.SET_BIOMETRIC_DIALOG_ADVANCED") https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Builder#setLogoBitmap(android.graphics.Bitmap)(https://developer.android.com/reference/android/graphics/Bitmap.html logoBitmap)` The optional bitmap drawable of the logo that will be shown on the prompt. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Builder` | `@https://developer.android.com/reference/androidx/annotation/RequiresPermission(value = "android.permission.SET_BIOMETRIC_DIALOG_ADVANCED") https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Builder#setLogoDescription(kotlin.String)(https://developer.android.com/reference/java/lang/String.html logoDescription)` The optional logo description text that will be shown on the prompt. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Builder` | `@https://developer.android.com/reference/androidx/annotation/RequiresPermission(value = "android.permission.SET_BIOMETRIC_DIALOG_ADVANCED") https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Builder#setLogoRes(kotlin.Int)(@https://developer.android.com/reference/androidx/annotation/DrawableRes int logoRes)` The optional drawable resource of the logo that will be shown on the prompt. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Builder` | `https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Builder#setMinStrength(androidx.biometric.AuthenticationRequest.Biometric.Strength)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Strength minStrength )` The minimum biometric strength for the authentication. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Builder` | `https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Builder#setSubtitle(kotlin.String)(https://developer.android.com/reference/java/lang/String.html subtitle)` The optional subtitle of the prompt. |

## Public constructors

### Builder

Added in [1.4.0-beta01](https://developer.android.com/jetpack/androidx/releases/biometric#1.4.0-beta01)

```
public Builder(
    @NonNull String title,
    @NonNull AuthenticationRequest.Biometric.Fallback... authFallbacks
)
```

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html title` | The title of the prompt. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Fallback... authFallbacks` | A list of `https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Fallback` options (up to `https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.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. |

## Public methods

### build

Added in [1.4.0-beta01](https://developer.android.com/jetpack/androidx/releases/biometric#1.4.0-beta01)

```
public final @NonNull AuthenticationRequest.Biometric build()
```

Construct an instance of `https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric`.

### setContent

Added in [1.4.0-beta01](https://developer.android.com/jetpack/androidx/releases/biometric#1.4.0-beta01)

```
public final @NonNull AuthenticationRequest.Biometric.Builder setContent(AuthenticationRequest.BodyContent content)
```

The optional `https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.BodyContent` of the prompt.

### setIsConfirmationRequired

Added in [1.4.0-beta01](https://developer.android.com/jetpack/androidx/releases/biometric#1.4.0-beta01)

```
public final @NonNull AuthenticationRequest.Biometric.Builder setIsConfirmationRequired(boolean isConfirmationRequired)
```

Whether user confirmation should be required for passive biometrics.

### setLogoBitmap

Added in [1.4.0-beta01](https://developer.android.com/jetpack/androidx/releases/biometric#1.4.0-beta01)

```
@RequiresPermission(value = "android.permission.SET_BIOMETRIC_DIALOG_ADVANCED")
public final @NonNull AuthenticationRequest.Biometric.Builder setLogoBitmap(Bitmap logoBitmap)
```

The optional bitmap drawable of the logo that will be shown on the prompt. Note that using this method is not recommended in most scenarios because the calling application's icon will be used by default. Setting the logo is intended for large bundled applications that perform a wide range of functions and need to show distinct icons for each function. This requires `https://developer.android.com/reference/android/Manifest.permission.html#SET_BIOMETRIC_DIALOG_ADVANCED` permission.

### setLogoDescription

Added in [1.4.0-beta01](https://developer.android.com/jetpack/androidx/releases/biometric#1.4.0-beta01)

```
@RequiresPermission(value = "android.permission.SET_BIOMETRIC_DIALOG_ADVANCED")
public final @NonNull AuthenticationRequest.Biometric.Builder setLogoDescription(String logoDescription)
```

The optional logo description text that will be shown on the prompt. Note that using this method is not recommended in most scenarios because the calling application's name will be used by default. Setting the logo description is intended for large bundled applications that perform a wide range of functions and need to show distinct description for each function. This requires `https://developer.android.com/reference/android/Manifest.permission.html#SET_BIOMETRIC_DIALOG_ADVANCED` permission.

### setLogoRes

Added in [1.4.0-beta01](https://developer.android.com/jetpack/androidx/releases/biometric#1.4.0-beta01)

```
@RequiresPermission(value = "android.permission.SET_BIOMETRIC_DIALOG_ADVANCED")
public final @NonNull AuthenticationRequest.Biometric.Builder setLogoRes(@DrawableRes int logoRes)
```

The optional drawable resource of the logo that will be shown on the prompt. Note that using this method is not recommended in most scenarios because the calling application's icon will be used by default. Setting the logo is intended for large bundled applications that perform a wide range of functions and need to show distinct icons for each function. This requires `https://developer.android.com/reference/android/Manifest.permission.html#SET_BIOMETRIC_DIALOG_ADVANCED` permission.

### setMinStrength

Added in [1.4.0-beta01](https://developer.android.com/jetpack/androidx/releases/biometric#1.4.0-beta01)

```
public final @NonNull AuthenticationRequest.Biometric.Builder setMinStrength(
    @NonNull AuthenticationRequest.Biometric.Strength minStrength
)
```

The minimum biometric strength for the authentication. Note that **Class 3** biometrics are guaranteed to meet the requirements for **Class 2** and thus will also be accepted.

### setSubtitle

Added in [1.4.0-beta01](https://developer.android.com/jetpack/androidx/releases/biometric#1.4.0-beta01)

```
public final @NonNull AuthenticationRequest.Biometric.Builder setSubtitle(String subtitle)
```

The optional subtitle of the prompt.