# AuthenticationRequest.Companion

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

*** ** * ** ***


```
public static class AuthenticationRequest.Companion
```

<br />

*** ** * ** ***

## Summary

| ### Public methods |
|---|---|
| `static 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.Companion#biometricRequest(kotlin.String,kotlin.Array,kotlin.Function1)( @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, @https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Builder, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> init )` Construct an instance of `https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric` that includes a set of configurable options for how the biometric prompt should appear and behave with biometric authentication with fallbacks. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Credential` | `@https://developer.android.com/reference/androidx/annotation/RequiresApi(value = 30) https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Companion#credentialRequest(kotlin.String,kotlin.Function1)( @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 Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Credential.Builder, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> init )` Construct an instance of `https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.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.Builder, Unit> init
)
```

Construct an instance of `https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.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 `https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Builder` instead.

| 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. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric.Builder, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> init` | A block to configure the `https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Biometric` instance. |

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

### credentialRequest

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

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

Construct an instance of `https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.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 `https://developer.android.com/reference/androidx/biometric/AuthenticationRequest.Credential.Builder` instead.