GetCustomCredentialOption
open class GetCustomCredentialOption : CredentialOption
Allows extending custom versions of GetCredentialOptions for unique use cases.
If you get a GetCustomCredentialOption instead of a type-safe option class such as GetPasswordOption, GetPublicKeyCredentialOption, etc., then you should check if you have any other library at interest that supports this custom type of credential option, and if so use its parsing utilities to resolve to a type-safe class within that library.
Note: The Bundle keys for requestData and candidateQueryData should not be in the form of androidx.credentials.* as they are reserved for internal use by this androidx library.
The typePriorityHint bit helps decide where the credential will be displayed on the selector. It is used with more importance than signals like 'last recently used' but with less importance than other signals, such as the ordering of displayed accounts. It is expected to be one of the defined CredentialOption.PRIORITY_* constants. By default, GetCustomCredentialOption will have CredentialOption.PRIORITY_DEFAULT, GetPasswordOption will have CredentialOption.PRIORITY_PASSWORD_OR_SIMILAR and GetPublicKeyCredentialOption will have CredentialOption.PRIORITY_PASSKEY_OR_SIMILAR. It is expected that GetCustomCredentialOption types will remain unchanged unless strong reasons arise and cannot ever have CredentialOption.PRIORITY_PASSKEY_OR_SIMILAR. Given passkeys prevent many security threats that other credentials do not, we enforce that nothing is shown higher than passkey types in order to provide end users with the safest credentials first. See the spec here for more information on passkeys.
Summary
Public constructors |
|---|
GetCustomCredentialOption(Allows extending custom versions of GetCredentialOptions for unique use cases. |
GetCustomCredentialOption(Allows extending custom versions of GetCredentialOptions for unique use cases. |
Inherited properties |
||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Public constructors
GetCustomCredentialOption
GetCustomCredentialOption(
type: String,
requestData: Bundle,
candidateQueryData: Bundle,
isSystemProviderRequired: Boolean,
isAutoSelectAllowed: Boolean = false,
allowedProviders: Set<ComponentName> = emptySet()
)
Allows extending custom versions of GetCredentialOptions for unique use cases.
If you get a GetCustomCredentialOption instead of a type-safe option class such as GetPasswordOption, GetPublicKeyCredentialOption, etc., then you should check if you have any other library at interest that supports this custom type of credential option, and if so use its parsing utilities to resolve to a type-safe class within that library.
Note: The Bundle keys for requestData and candidateQueryData should not be in the form of androidx.credentials.* as they are reserved for internal use by this androidx library.
| Parameters | |
|---|---|
type: String |
the credential type determined by the credential-type-specific subclass generated for custom use cases |
requestData: Bundle |
the request data in the |
candidateQueryData: Bundle |
the partial request data in the |
isSystemProviderRequired: Boolean |
true if must only be fulfilled by a system provider and false otherwise |
isAutoSelectAllowed: Boolean = false |
defines if a credential entry will be automatically chosen if it is the only one available option, false by default |
allowedProviders: Set<ComponentName> = emptySet() |
a set of provider service |
| Throws | |
|---|---|
kotlin.IllegalArgumentException |
If |
kotlin.NullPointerException |
If |
GetCustomCredentialOption
GetCustomCredentialOption(
type: String,
requestData: Bundle,
candidateQueryData: Bundle,
isSystemProviderRequired: Boolean,
isAutoSelectAllowed: Boolean = false,
allowedProviders: Set<ComponentName> = emptySet(),
typePriorityHint: Int = PRIORITY_DEFAULT
)
Allows extending custom versions of GetCredentialOptions for unique use cases.
If you get a GetCustomCredentialOption instead of a type-safe option class such as GetPasswordOption, GetPublicKeyCredentialOption, etc., then you should check if you have any other library at interest that supports this custom type of credential option, and if so use its parsing utilities to resolve to a type-safe class within that library.
Note: The Bundle keys for requestData and candidateQueryData should not be in the form of androidx.credentials.* as they are reserved for internal use by this androidx library.
The typePriorityHint bit helps decide where the credential will be displayed on the selector. It is expected that GetCustomCredentialOption types will remain unchanged unless strong reasons arise and cannot ever have CredentialOption.PRIORITY_PASSKEY_OR_SIMILAR. Given passkeys prevent many security threats that other credentials do not, we enforce that nothing is shown higher than passkey types in order to provide end users with the safest credentials first. See the spec here for more information on passkeys.
| Parameters | |
|---|---|
type: String |
the credential type determined by the credential-type-specific subclass generated for custom use cases |
requestData: Bundle |
the request data in the |
candidateQueryData: Bundle |
the partial request data in the |
isSystemProviderRequired: Boolean |
true if must only be fulfilled by a system provider and false otherwise |
isAutoSelectAllowed: Boolean = false |
defines if a credential entry will be automatically chosen if it is the only one available option, false by default |
allowedProviders: Set<ComponentName> = emptySet() |
a set of provider service |
typePriorityHint: Int = PRIORITY_DEFAULT |
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 |
| Throws | |
|---|---|
kotlin.IllegalArgumentException |
If |
kotlin.NullPointerException |
If |