GetPasswordOption


class GetPasswordOption : CredentialOption


A request to retrieve the user's saved application password from their password provider.

Summary

Public constructors

GetPasswordOption(
    allowedUserIds: Set<String>,
    isAutoSelectAllowed: Boolean,
    allowedProviders: Set<ComponentName>
)

Constructs a GetPasswordOption.

Public properties

Set<String>

a optional set of user ids with which the credentials associated are requested; leave as empty if you want to request all the available user credentials

Inherited properties

From androidx.credentials.CredentialOption
Set<ComponentName>

a set of provider service ComponentName allowed to receive this option (Note: a SecurityException will be thrown if it is set as non-empty but your app does not have android.permission.CREDENTIAL_MANAGER_SET_ALLOWED_PROVIDERS; empty means every provider is eligible; for API level < 34, this property will not take effect and you should control the allowed provider via library dependencies)

Bundle

the partial request data in the Bundle format that will be sent to the provider during the initial candidate query stage, which will not contain sensitive user information

Boolean

whether a credential entry will be automatically chosen if it is the only one available option

Boolean

true if must only be fulfilled by a system provider and false otherwise

Bundle

the request data in the Bundle format

String

the credential type determined by the credential-type-specific subclass (e.g. the type for GetPasswordOption is PasswordCredential.TYPE_PASSWORD_CREDENTIAL and for GetPublicKeyCredentialOption is PublicKeyCredential.TYPE_PUBLIC_KEY_CREDENTIAL)

Int

sets the priority of this entry, which defines how it appears in the credential selector, with less precedence than account ordering but more precedence than last used time; see PriorityHints for more information

Public constructors

GetPasswordOption

Added in 1.2.0
GetPasswordOption(
    allowedUserIds: Set<String> = emptySet(),
    isAutoSelectAllowed: Boolean = false,
    allowedProviders: Set<ComponentName> = emptySet()
)

Constructs a GetPasswordOption.

Parameters
allowedUserIds: Set<String> = emptySet()

a optional set of user ids with which the credentials associated are requested; leave as empty if you want to request all the available user credentials

isAutoSelectAllowed: Boolean = false

false by default, allows auto selecting a password if there is only one available

allowedProviders: Set<ComponentName> = emptySet()

a set of provider service ComponentName allowed to receive this option (Note: a SecurityException will be thrown if it is set as non-empty but your app does not have android.permission.CREDENTIAL_MANAGER_SET_ALLOWED_PROVIDERS; for API level < 34, this property will not take effect and you should control the allowed provider via library dependencies)

Public properties

allowedUserIds

Added in 1.2.0
val allowedUserIdsSet<String>

a optional set of user ids with which the credentials associated are requested; leave as empty if you want to request all the available user credentials