CredentialEntry


public 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 methods

static final CredentialEntry

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

final 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

final @NonNull BeginGetCredentialOption

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

final @NonNull CharSequence

an ID used for deduplication or to group entries during display

final 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 methods

fromCredentialEntry

Added in 1.3.0-alpha03
public static final CredentialEntry fromCredentialEntry(@NonNull 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
@NonNull CredentialEntry credentialEntry

the instance of framework class to be converted

getAffiliatedDomain

Added in 1.3.0-alpha03
public final CharSequence getAffiliatedDomain()

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

getBeginGetCredentialOption

Added in 1.2.0
public final @NonNull BeginGetCredentialOption getBeginGetCredentialOption()

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

getEntryGroupId

Added in 1.3.0-alpha03
public final @NonNull CharSequence getEntryGroupId()

an ID used for deduplication or to group entries during display

isDefaultIconPreferredAsSingleProvider

Added in 1.3.0-alpha03
public final boolean 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 PublicKeyCredentialEntry, it is based on R.drawable.ic_password)