# GetCredentialRequest

# GetCredentialRequest


```
public final class GetCredentialRequest implements Parcelable
```

<br />

*** ** * ** ***

Data interface for retrieving a user credential.

## Summary

| ### Public fields |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull.html https://developer.android.com/reference/android/os/Parcelable.Creator.html<@https://developer.android.com/reference/androidx/annotation/NonNull.html https://developers.google.com/android/reference/com/google/android/gms/identitycredentials/GetCredentialRequest>` | `https://developers.google.com/android/reference/com/google/android/gms/identitycredentials/GetCredentialRequest#CREATOR()` |

| ### Public constructors |
|---|
| `https://developers.google.com/android/reference/com/google/android/gms/identitycredentials/GetCredentialRequest#GetCredentialRequest(kotlin.collections.List,android.os.Bundle,kotlin.String,android.os.ResultReceiver)( @https://developer.android.com/reference/androidx/annotation/NonNull.html https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull.html https://developers.google.com/android/reference/com/google/android/gms/identitycredentials/CredentialOption> credentialOptions, @https://developer.android.com/reference/androidx/annotation/NonNull.html https://developer.android.com/reference/android/os/Bundle.html data, https://developer.android.com/reference/java/lang/String.html origin, @https://developer.android.com/reference/androidx/annotation/NonNull.html https://developer.android.com/reference/android/os/ResultReceiver.html resultReceiver )` constructs an instance of `https://developers.google.com/android/reference/com/google/android/gms/identitycredentials/GetCredentialRequest` |

| ### Public methods |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/NonNull.html https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull.html https://developers.google.com/android/reference/com/google/android/gms/identitycredentials/CredentialOption>` | `https://developers.google.com/android/reference/com/google/android/gms/identitycredentials/GetCredentialRequest#getCredentialOptions()()` the list of credential options |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull.html https://developer.android.com/reference/android/os/Bundle.html` | `https://developers.google.com/android/reference/com/google/android/gms/identitycredentials/GetCredentialRequest#getData()()` the additional data to be used for retrieving the credential |
| `final https://developer.android.com/reference/java/lang/String.html` | `https://developers.google.com/android/reference/com/google/android/gms/identitycredentials/GetCredentialRequest#getOrigin()()` the origin of the request, only settable by a browser |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull.html https://developer.android.com/reference/android/os/ResultReceiver.html` | `[getResultReceiver](https://developers.google.com/android/reference/com/google/android/gms/identitycredentials/GetCredentialRequest#getResultReceiver())()` **This method is deprecated.** Deprecated. |
| `void` | `https://developers.google.com/android/reference/com/google/android/gms/identitycredentials/GetCredentialRequest#writeToParcel(android.os.Parcel,kotlin.Int)(@https://developer.android.com/reference/androidx/annotation/NonNull.html https://developer.android.com/reference/android/os/Parcel.html dest, int flags)` |

## Public fields

### CREATOR

```
public static final @NonNull Parcelable.Creator<@NonNull GetCredentialRequest> CREATOR
```

## Public constructors

### GetCredentialRequest

```
public GetCredentialRequest(
    @NonNull List<@NonNull CredentialOption> credentialOptions,
    @NonNull Bundle data,
    String origin,
    @NonNull ResultReceiver resultReceiver
)
```

constructs an instance of `https://developers.google.com/android/reference/com/google/android/gms/identitycredentials/GetCredentialRequest`

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull.html https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull.html https://developers.google.com/android/reference/com/google/android/gms/identitycredentials/CredentialOption> credentialOptions` | the list of credential options |
| `@https://developer.android.com/reference/androidx/annotation/NonNull.html https://developer.android.com/reference/android/os/Bundle.html data` | the additional data to be used for retrieving the credential |
| `https://developer.android.com/reference/java/lang/String.html origin` | the origin of the request, only settable by a browser |
| `@https://developer.android.com/reference/androidx/annotation/NonNull.html https://developer.android.com/reference/android/os/ResultReceiver.html resultReceiver` | deprecated |

## Public methods

### getCredentialOptions

```
public final @NonNull List<@NonNull CredentialOption> getCredentialOptions()
```

the list of credential options

### getData

```
public final @NonNull Bundle getData()
```

the additional data to be used for retrieving the credential

### getOrigin

```
public final String getOrigin()
```

the origin of the request, only settable by a browser

### getResultReceiver

```
public final @NonNull ResultReceiver [getResultReceiver](https://developers.google.com/android/reference/com/google/android/gms/identitycredentials/GetCredentialRequest#getResultReceiver())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated. Do not use this to receive the credential result and instead rely on the ActivityResultContract https://developer.android.com/training/basics/intents/result.

deprecated

### writeToParcel

```
public void writeToParcel(@NonNull Parcel dest, int flags)
```