# BeginGetPasswordOption

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

*** ** * ** ***


```
public final class BeginGetPasswordOption extends BeginGetCredentialOption
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.credentials.provider.BeginGetCredentialOption](https://developer.android.com/reference/androidx/credentials/provider/BeginGetCredentialOption) ||
|   | ↳ | [androidx.credentials.provider.BeginGetPasswordOption](https://developer.android.com/reference/androidx/credentials/provider/BeginGetPasswordOption) |

*** ** * ** ***

A request to a password provider to begin the flow of retrieving the user's saved passwords.

Providers must use the parameters in this option to retrieve the corresponding credentials' metadata, and then return them in the form of a list of `https://developer.android.com/reference/androidx/credentials/provider/PasswordCredentialEntry` set on the `https://developer.android.com/reference/android/service/credentials/BeginGetCredentialResponse.html`.

Note : Credential providers are not expected to utilize the constructor in this class for any production flow. This constructor must only be used for testing purposes.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/credentials/provider/BeginGetPasswordOption#BeginGetPasswordOption(kotlin.collections.Set,android.os.Bundle,kotlin.String)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html> allowedUserIds, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/Bundle.html candidateQueryData, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html id )` |

| ### Public methods |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html>` | `https://developer.android.com/reference/androidx/credentials/provider/BeginGetPasswordOption#getAllowedUserIds()()` a optional set of user ids with which the credentials associated are requested; left as empty if the caller app wants to request all the available user credentials |

| ### Inherited methods |
|---|
| From [androidx.credentials.provider.BeginGetCredentialOption](https://developer.android.com/reference/androidx/credentials/provider/BeginGetCredentialOption) |---|---| | `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/Bundle.html` | `https://developer.android.com/reference/androidx/credentials/provider/BeginGetCredentialOption#getCandidateQueryData()()` 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 | | `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/credentials/provider/BeginGetCredentialOption#getId()()` unique id representing this particular option, to be used while constructing the `https://developer.android.com/reference/androidx/credentials/provider/CredentialEntry` to be set on `https://developer.android.com/reference/androidx/credentials/provider/BeginGetCredentialResponse` | | `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/credentials/provider/BeginGetCredentialOption#getType()()` the type of the credential to be retrieved against this option, e.g. a `https://developer.android.com/reference/androidx/credentials/provider/BeginGetPasswordOption` will have type `https://developer.android.com/reference/androidx/credentials/PasswordCredential#TYPE_PASSWORD_CREDENTIAL()` | |

## Public constructors

### BeginGetPasswordOption

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

```
public BeginGetPasswordOption(
    @NonNull Set<@NonNull String> allowedUserIds,
    @NonNull Bundle candidateQueryData,
    @NonNull String id
)
```

## Public methods

### getAllowedUserIds

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

```
public final @NonNull Set<@NonNull String> getAllowedUserIds()
```

a optional set of user ids with which the credentials associated are requested; left as empty if the caller app wants to request all the available user credentials