CredentialEntry


abstract class CredentialEntry

Known direct subclasses
CustomCredentialEntry

Custom credential entry for a custom credential type that is displayed on the account selector UI.

PasswordCredentialEntry

A password credential entry that is displayed on the account selector UI.

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 entryGroupId allows the credential selector display to, in the case of multiple entries across providers that have the same 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. PublicKeyCredentialEntry and 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 CustomCredentialEntry are created.

(RestrictTo property) type the type of the credential associated with this entry, e.g. a BeginGetPasswordOption will have type TYPE_PASSWORD_CREDENTIAL

Summary

Public companion functions

CredentialEntry?

Converts a framework android.service.credentials.CredentialEntry class to a Jetpack CredentialEntry class

Public properties

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

the option from the original BeginGetCredentialRequest, for which this credential entry is being added

CharSequence

an ID used for deduplication or to group entries during display

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 PublicKeyCredentialEntry, it is based on R.drawable.ic_password)

Public companion functions

fromCredentialEntry

Added in 1.3.0-alpha03
fun fromCredentialEntry(credentialEntry: CredentialEntry): CredentialEntry?

Converts a framework android.service.credentials.CredentialEntry class to a Jetpack 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 CredentialEntry to populate the BeginGetCredentialResponse.

Parameters
credentialEntry: CredentialEntry

the instance of framework class to be converted

Public properties

affiliatedDomain

Added in 1.3.0-alpha03
val affiliatedDomainCharSequence?

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
val beginGetCredentialOptionBeginGetCredentialOption

the option from the original BeginGetCredentialRequest, for which this credential entry is being added

entryGroupId

Added in 1.3.0-alpha03
val entryGroupIdCharSequence

an ID used for deduplication or to group entries during display

isDefaultIconPreferredAsSingleProvider

Added in 1.3.0-alpha03
val isDefaultIconPreferredAsSingleProviderBoolean

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 PublicKeyCredentialEntry, it is based on R.drawable.ic_password)