# CredentialEntry

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

*** ** * ** ***

<br />

```
abstract class CredentialEntry
```

<br />

Known direct subclasses [CustomCredentialEntry](https://developer.android.com/reference/kotlin/androidx/credentials/provider/CustomCredentialEntry), [PasswordCredentialEntry](https://developer.android.com/reference/kotlin/androidx/credentials/provider/PasswordCredentialEntry), [PublicKeyCredentialEntry](https://developer.android.com/reference/kotlin/androidx/credentials/provider/PublicKeyCredentialEntry)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CustomCredentialEntry` | Custom credential entry for a custom credential type that is displayed on the account selector UI. |
| `https://developer.android.com/reference/kotlin/androidx/credentials/provider/PasswordCredentialEntry` | A password credential entry that is displayed on the account selector UI. |
| `https://developer.android.com/reference/kotlin/androidx/credentials/provider/PublicKeyCredentialEntry` | A public key credential entry that is displayed on the account selector UI. |

*** ** * ** ***

Base class for a credential entry to be displayed on the selector.

The `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CredentialEntry#entryGroupId()` allows the credential selector display to, in the case of multiple entries across providers that have the same `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CredentialEntry#entryGroupId()` value, trim down to a single, most recently used provider on the primary card, meant for quick authentication. This will also be used for entry grouping display logic. However, if the user desires, it is possible to expand back the entries and select the provider of their choice. This should be something directly linked to the credential (e.g. `https://developer.android.com/reference/kotlin/androidx/credentials/provider/PublicKeyCredentialEntry` and `https://developer.android.com/reference/kotlin/androidx/credentials/provider/PasswordCredentialEntry` utilize 'username'), and should allow variance only as far as the case of letters (i.e. Foo@gmail.com and foo@gmail.com). These guidelines should be followed in cases where `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CustomCredentialEntry` are created.

(RestrictTo property) type the type of the credential associated with this entry, 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()`

## Summary

| ### Public companion functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CredentialEntry?` | `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CredentialEntry#fromCredentialEntry(android.service.credentials.CredentialEntry)(credentialEntry: https://developer.android.com/reference/android/service/credentials/CredentialEntry.html)` Converts a framework `https://developer.android.com/reference/android/service/credentials/CredentialEntry.html` class to a Jetpack `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CredentialEntry` class |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html?` | `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CredentialEntry#affiliatedDomain()` the user visible affiliated domain, a CharSequence representation of a web domain or an app package name that the given credential in this entry is associated with when it is different from the requesting entity, default null |
| `https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetCredentialOption` | `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CredentialEntry#beginGetCredentialOption()` the option from the original `https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetCredentialRequest`, for which this credential entry is being added |
| `https://developer.android.com/reference/kotlin/androidx/credentials/provider/BiometricPromptData?` | `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CredentialEntry#biometricPromptData()` the data that is set optionally to utilize a credential manager flow that directly handles the biometric verification and presents back the response; set to null by default, so if not opted in, the embedded biometric prompt flow will not show |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html` | `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CredentialEntry#entryGroupId()` an ID used for deduplication or to group entries during display |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CredentialEntry#isDefaultIconPreferredAsSingleProvider()` when set to true, the UI prefers to render the default credential type icon when you are the only available provider; see individual subclasses for these default icons (e.g. for `https://developer.android.com/reference/kotlin/androidx/credentials/provider/PublicKeyCredentialEntry`, it is based on `R.drawable.adx_ic_password`) |

## Public companion functions

### fromCredentialEntry

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

```
fun fromCredentialEntry(credentialEntry: CredentialEntry): CredentialEntry?
```

Converts a framework `https://developer.android.com/reference/android/service/credentials/CredentialEntry.html` class to a Jetpack `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CredentialEntry` class

Note that this API is not needed in a general credential retrieval flow that is implemented using this jetpack library, where you are only required to construct an instance of `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CredentialEntry` to populate the `https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetCredentialResponse`.

| Parameters |
|---|---|
| `credentialEntry: https://developer.android.com/reference/android/service/credentials/CredentialEntry.html` | the instance of framework class to be converted |

## Public properties

### affiliatedDomain

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

```
val affiliatedDomain: CharSequence?
```

the user visible affiliated domain, a CharSequence representation of a web domain or an app package name that the given credential in this entry is associated with when it is different from the requesting entity, default null

### beginGetCredentialOption

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

```
val beginGetCredentialOption: BeginGetCredentialOption
```

the option from the original `https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetCredentialRequest`, for which this credential entry is being added

### biometricPromptData

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

```
val biometricPromptData: BiometricPromptData?
```

the data that is set optionally to utilize a credential manager flow that directly handles the biometric verification and presents back the response; set to null by default, so if not opted in, the embedded biometric prompt flow will not show

### entryGroupId

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

```
val entryGroupId: CharSequence
```

an ID used for deduplication or to group entries during display

### isDefaultIconPreferredAsSingleProvider

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

```
val isDefaultIconPreferredAsSingleProvider: Boolean
```

when set to true, the UI prefers to render the default credential type icon when you are the only available provider; see individual subclasses for these default icons (e.g. for `https://developer.android.com/reference/kotlin/androidx/credentials/provider/PublicKeyCredentialEntry`, it is based on `R.drawable.adx_ic_password`)