# GetCredentialRequest

# GetCredentialRequest


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

<br />

*** ** * ** ***

Data interface for retrieving a user credential.

## Summary

| ### Public fields |
|---|---|
| `static final @NonNull Parcelable.Creator<@NonNull GetCredentialRequest>` | `CREATOR` |

| ### Public constructors |
|---|
| `GetCredentialRequest( @NonNull List<@NonNull CredentialOption> credentialOptions, @NonNull Bundle data, String origin, @NonNull ResultReceiver resultReceiver )` constructs an instance of `GetCredentialRequest` |

| ### Public methods |
|---|---|
| `final @NonNull List<@NonNull CredentialOption>` | `getCredentialOptions()` the list of credential options |
| `final @NonNull Bundle` | `getData()` the additional data to be used for retrieving the credential |
| `final String` | `getOrigin()` the origin of the request, only settable by a browser |
| `final @NonNull ResultReceiver` | `[getResultReceiver](https://developers.google.com/android/reference/com/google/android/gms/identitycredentials/GetCredentialRequest#getResultReceiver())()` **This method is deprecated.** Deprecated. |
| `void` | `writeToParcel(@NonNull Parcel 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 `GetCredentialRequest`

| Parameters |
|---|---|
| `@NonNull List<@NonNull CredentialOption> credentialOptions` | the list of credential options |
| `@NonNull Bundle data` | the additional data to be used for retrieving the credential |
| `String origin` | the origin of the request, only settable by a browser |
| `@NonNull ResultReceiver 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)
```