GetCustomCredentialOption
public class GetCustomCredentialOption extends CredentialOption
| java.lang.Object | ||
| ↳ | androidx.credentials.CredentialOption | |
| ↳ | androidx.credentials.GetCustomCredentialOption |
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 methods |
||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Public constructors
GetCustomCredentialOption
public GetCustomCredentialOption(
@NonNull String type,
@NonNull Bundle requestData,
@NonNull Bundle candidateQueryData,
boolean isSystemProviderRequired,
boolean isAutoSelectAllowed,
@NonNull Set<@NonNull ComponentName> allowedProviders
)
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 | |
|---|---|
@NonNull String type |
the credential type determined by the credential-type-specific subclass generated for custom use cases |
@NonNull Bundle requestData |
the request data in the |
@NonNull Bundle candidateQueryData |
the partial request data in the |
boolean isSystemProviderRequired |
true if must only be fulfilled by a system provider and false otherwise |
boolean isAutoSelectAllowed |
defines if a credential entry will be automatically chosen if it is the only one available option, false by default |
@NonNull Set<@NonNull ComponentName> allowedProviders |
a set of provider service |
| Throws | |
|---|---|
kotlin.IllegalArgumentException |
If |
kotlin.NullPointerException |
If |
GetCustomCredentialOption
public GetCustomCredentialOption(
@NonNull String type,
@NonNull Bundle requestData,
@NonNull Bundle candidateQueryData,
boolean isSystemProviderRequired,
boolean isAutoSelectAllowed,
@NonNull Set<@NonNull ComponentName> allowedProviders,
int typePriorityHint
)
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 | |
|---|---|
@NonNull String type |
the credential type determined by the credential-type-specific subclass generated for custom use cases |
@NonNull Bundle requestData |
the request data in the |
@NonNull Bundle candidateQueryData |
the partial request data in the |
boolean isSystemProviderRequired |
true if must only be fulfilled by a system provider and false otherwise |
boolean isAutoSelectAllowed |
defines if a credential entry will be automatically chosen if it is the only one available option, false by default |
@NonNull Set<@NonNull ComponentName> allowedProviders |
a set of provider service |
int typePriorityHint |
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 |