# BeginGetCredentialOption

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

*** ** * ** ***

<br />

```
abstract class BeginGetCredentialOption
```

<br />

Known direct subclasses [BeginGetCustomCredentialOption](https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetCustomCredentialOption), [BeginGetPasswordOption](https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetPasswordOption), [BeginGetPublicKeyCredentialOption](https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetPublicKeyCredentialOption)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetCustomCredentialOption` | Allows extending custom versions of BeginGetCredentialOptions for unique use cases. |
| `https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetPasswordOption` | A request to a password provider to begin the flow of retrieving the user's saved passwords. |
| `https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetPublicKeyCredentialOption` | A request to begin the flow of getting passkeys from the user's public key credential provider. |

*** ** * ** ***

Base class that a credential provider receives during the query phase of a get-credential flow. Classes derived from this base class contain parameters required to retrieve a specific type of credential. E.g. `https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetPasswordOption` contains parameters required to retrieve passwords.

`https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetCredentialRequest` will be composed of a list of `https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetCredentialOption` subclasses to indicate the specific credential types and configurations that the credential provider must include while building the `https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetCredentialResponse`.

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

## Summary

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/android/os/Bundle.html` | `https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetCredentialOption#candidateQueryData()` the parameters needed to retrieve the credentials, in the form of the raw `https://developer.android.com/reference/android/os/Bundle.html` - can typically be ignored by the credential provider as the required properties are already parse into the structured subclasses |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetCredentialOption#id()` unique id representing this particular option, to be used while constructing the `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CredentialEntry` to be set on `https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetCredentialResponse` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetCredentialOption#type()` the type of the credential to be retrieved against this option, e.g. a `https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetPasswordOption` will have type `https://developer.android.com/reference/kotlin/androidx/credentials/PasswordCredential#TYPE_PASSWORD_CREDENTIAL()` |

## Public properties

### candidateQueryData

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

```
val candidateQueryData: Bundle
```

the parameters needed to retrieve the credentials, in the form of the raw `https://developer.android.com/reference/android/os/Bundle.html` - can typically be ignored by the credential provider as the required properties are already parse into the structured subclasses

### id

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

```
val id: String
```

unique id representing this particular option, to be used while constructing the `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CredentialEntry` to be set on `https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetCredentialResponse`

### type

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

```
val type: String
```

the type of the credential to be retrieved against this option, e.g. a `https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetPasswordOption` will have type `https://developer.android.com/reference/kotlin/androidx/credentials/PasswordCredential#TYPE_PASSWORD_CREDENTIAL()`