# ProviderCreateCredentialRequest

Artifact: [androidx.credentials:credentials](https://developer.android.com/jetpack/androidx/releases/credentials) [View Source](https://cs.android.com/search?q=file:androidx/credentials/provider/ProviderCreateCredentialRequest.kt+class:androidx.credentials.provider.ProviderCreateCredentialRequest) Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/credentials#1.2.0)

*** ** * ** ***

<br />

```
class ProviderCreateCredentialRequest
```

<br />

*** ** * ** ***

Final request received by the provider after the user has selected a given `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CreateEntry` on the UI.

This request contains the actual request coming from the calling app, and the application information associated with the calling app.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-null-pointer-exception/index.html` | If `https://developer.android.com/reference/kotlin/androidx/credentials/provider/ProviderCreateCredentialRequest#callingRequest()`, or `https://developer.android.com/reference/kotlin/androidx/credentials/provider/ProviderCreateCredentialRequest#callingAppInfo()` is null |

## Summary

| ### Public companion functions |
|---|---|
| `https://developer.android.com/reference/android/os/Bundle.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi(value = 23) https://developer.android.com/reference/kotlin/androidx/credentials/provider/ProviderCreateCredentialRequest#asBundle(androidx.credentials.provider.ProviderCreateCredentialRequest)(request: https://developer.android.com/reference/kotlin/androidx/credentials/provider/ProviderCreateCredentialRequest)` Helper method to convert the given `https://developer.android.com/reference/kotlin/androidx/credentials/provider/ProviderCreateCredentialRequest.Companion#asBundle(androidx.credentials.provider.ProviderCreateCredentialRequest)` to a parcelable `https://developer.android.com/reference/android/os/Bundle.html`, in case the instance needs to be sent across a process. |
| `https://developer.android.com/reference/kotlin/androidx/credentials/provider/ProviderCreateCredentialRequest` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi(value = 23) https://developer.android.com/reference/kotlin/androidx/credentials/provider/ProviderCreateCredentialRequest#fromBundle(android.os.Bundle)(bundle: https://developer.android.com/reference/android/os/Bundle.html)` Helper method to convert a `https://developer.android.com/reference/android/os/Bundle.html` retrieved through `https://developer.android.com/reference/kotlin/androidx/credentials/provider/ProviderCreateCredentialRequest#asBundle(androidx.credentials.provider.ProviderCreateCredentialRequest)`, back to an instance of `https://developer.android.com/reference/kotlin/androidx/credentials/provider/ProviderCreateCredentialRequest`. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/credentials/provider/ProviderCreateCredentialRequest#ProviderCreateCredentialRequest(androidx.credentials.CreateCredentialRequest,androidx.credentials.provider.CallingAppInfo,androidx.credentials.provider.BiometricPromptResult)( callingRequest: https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest, callingAppInfo: https://developer.android.com/reference/kotlin/androidx/credentials/provider/CallingAppInfo, biometricPromptResult: https://developer.android.com/reference/kotlin/androidx/credentials/provider/BiometricPromptResult? )` |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/credentials/provider/BiometricPromptResult?` | `https://developer.android.com/reference/kotlin/androidx/credentials/provider/ProviderCreateCredentialRequest#biometricPromptResult()` the result of a Biometric Prompt authentication flow, that is propagated to the provider if the provider requested for `https://developer.android.com/reference/kotlin/androidx/credentials/CredentialManager` to handle the authentication flow |
| `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CallingAppInfo` | `https://developer.android.com/reference/kotlin/androidx/credentials/provider/ProviderCreateCredentialRequest#callingAppInfo()` information pertaining to the calling app making the request |
| `https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest` | `https://developer.android.com/reference/kotlin/androidx/credentials/provider/ProviderCreateCredentialRequest#callingRequest()` the complete `https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest` coming from the calling app that is requesting for credential creation |

| ### Extension properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/kotlin/androidx/credentials/provider/ProviderCreateCredentialRequest.https://developer.android.com/reference/kotlin/androidx/credentials/provider/ProviderCreateCredentialRequest#(androidx.credentials.provider.ProviderCreateCredentialRequest).selectedEntryId()` Returns the id of the entry selected by the user. |

## Public companion functions

### asBundle

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/credentials#1.5.0)

```
@RequiresApi(value = 23)
fun asBundle(request: ProviderCreateCredentialRequest): Bundle
```

Helper method to convert the given `https://developer.android.com/reference/kotlin/androidx/credentials/provider/ProviderCreateCredentialRequest.Companion#asBundle(androidx.credentials.provider.ProviderCreateCredentialRequest)` to a parcelable `https://developer.android.com/reference/android/os/Bundle.html`, in case the instance needs to be sent across a process. Consumers of this method should use `https://developer.android.com/reference/kotlin/androidx/credentials/provider/ProviderCreateCredentialRequest#fromBundle(android.os.Bundle)` to reconstruct the class instance back from the bundle returned here.

### fromBundle

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/credentials#1.5.0)

```
@RequiresApi(value = 23)
fun fromBundle(bundle: Bundle): ProviderCreateCredentialRequest
```

Helper method to convert a `https://developer.android.com/reference/android/os/Bundle.html` retrieved through `https://developer.android.com/reference/kotlin/androidx/credentials/provider/ProviderCreateCredentialRequest#asBundle(androidx.credentials.provider.ProviderCreateCredentialRequest)`, back to an instance of `https://developer.android.com/reference/kotlin/androidx/credentials/provider/ProviderCreateCredentialRequest`.

Throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` if the conversion fails. This means that the given `https://developer.android.com/reference/kotlin/androidx/credentials/provider/ProviderCreateCredentialRequest.Companion#fromBundle(android.os.Bundle)` does not contain a `ProviderCreateCredentialRequest`. The bundle should be constructed and retrieved from `https://developer.android.com/reference/kotlin/androidx/credentials/provider/ProviderCreateCredentialRequest#asBundle(androidx.credentials.provider.ProviderCreateCredentialRequest)` itself and never be created from scratch to avoid the failure.

## Public constructors

### ProviderCreateCredentialRequest

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/credentials#1.5.0)

```
ProviderCreateCredentialRequest(
    callingRequest: CreateCredentialRequest,
    callingAppInfo: CallingAppInfo,
    biometricPromptResult: BiometricPromptResult? = null
)
```

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-null-pointer-exception/index.html` | If `https://developer.android.com/reference/kotlin/androidx/credentials/provider/ProviderCreateCredentialRequest#(androidx.credentials.CreateCredentialRequest,androidx.credentials.provider.CallingAppInfo,androidx.credentials.provider.BiometricPromptResult)`, or `https://developer.android.com/reference/kotlin/androidx/credentials/provider/ProviderCreateCredentialRequest#(androidx.credentials.CreateCredentialRequest,androidx.credentials.provider.CallingAppInfo,androidx.credentials.provider.BiometricPromptResult)` is null |

## Public properties

### biometricPromptResult

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/credentials#1.5.0)

```
val biometricPromptResult: BiometricPromptResult?
```

the result of a Biometric Prompt authentication flow, that is propagated to the provider if the provider requested for `https://developer.android.com/reference/kotlin/androidx/credentials/CredentialManager` to handle the authentication flow

### callingAppInfo

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/credentials#1.2.0)

```
val callingAppInfo: CallingAppInfo
```

information pertaining to the calling app making the request

### callingRequest

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/credentials#1.2.0)

```
val callingRequest: CreateCredentialRequest
```

the complete `https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest` coming from the calling app that is requesting for credential creation

## Extension properties

### ProviderCreateCredentialRequest.selectedEntryId

Artifact: [androidx.credentials.registry:registry-provider](https://developer.android.com/jetpack/androidx/releases/credentials-registry) [View Source](https://cs.android.com/search?q=file:androidx/credentials/registry/provider/ProviderCreateCredentialRequest.kt+symbol:selectedEntryId) Added in [1.0.0-alpha05](https://developer.android.com/jetpack/androidx/releases/credentials-registry#1.0.0-alpha05)

```
val ProviderCreateCredentialRequest.selectedEntryId: String?
```

Returns the id of the entry selected by the user.

A null return means that entry ID isn't supported for the given type of the use case at all.

For how to handle a user selection and extract the `https://developer.android.com/reference/kotlin/androidx/credentials/provider/ProviderCreateCredentialRequest` containing the selection information, see `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegistryManager#ACTION_CREATE_CREDENTIAL()`.