ProviderGetCredentialRequest
public final class ProviderGetCredentialRequest
Request received by the provider after the query phase of the get flow is complete i.e. the user was presented with a list of credentials, and the user has now made a selection from the list of CredentialEntry presented on the selector UI.
This request will be added to the intent extras of the activity invoked by the PendingIntent set on the CredentialEntry that the user selected. The request must be extracted using the PendingIntentHandler.retrieveProviderGetCredentialRequest helper API.
Summary
Public constructors |
|---|
ProviderGetCredentialRequest(Constructs an instance of |
Public methods |
|
|---|---|
static final @NonNull Bundle |
asBundle(@NonNull ProviderGetCredentialRequest request)Helper method to convert the given |
static final @NonNull ProviderGetCredentialRequest |
fromBundle(@NonNull Bundle bundle)Helper method to convert a |
final BiometricPromptResult |
the result of a Biometric Prompt authentication flow, that is propagated to the provider if the provider requested for |
final @NonNull CallingAppInfo |
information pertaining to the calling application |
final @NonNull List<@NonNull CredentialOption> |
the list of credential retrieval options containing the required parameters, expected to contain a single |
Extension functions |
|
|---|---|
final SelectedCredentialSet |
ProviderGetCredentialRequestKt.getSelectedCredentialSet(Returns credential set selected by the user. |
final String |
Returns the id of the entry selected by the user. |
Public constructors
ProviderGetCredentialRequest
public ProviderGetCredentialRequest(
@NonNull List<@NonNull CredentialOption> credentialOptions,
@NonNull CallingAppInfo callingAppInfo,
BiometricPromptResult biometricPromptResult
)
Constructs an instance of ProviderGetCredentialRequest
| Parameters | |
|---|---|
@NonNull List<@NonNull CredentialOption> credentialOptions |
the list of credential retrieval options containing the required parameters, expected to contain a single |
@NonNull CallingAppInfo callingAppInfo |
information pertaining to the calling application |
BiometricPromptResult biometricPromptResult |
the result of a Biometric Prompt authentication flow, that is propagated to the provider if the provider requested for |
Public methods
asBundle
public static final @NonNull Bundle asBundle(@NonNull ProviderGetCredentialRequest request)
Helper method to convert the given request to a parcelable Bundle, in case the instance needs to be sent across a process. Consumers of this method should use fromBundle to reconstruct the class instance back from the bundle returned here.
fromBundle
public static final @NonNull ProviderGetCredentialRequest fromBundle(@NonNull Bundle bundle)
Helper method to convert a Bundle retrieved through asBundle, back to an instance of ProviderGetCredentialRequest.
Throws IllegalArgumentException if the conversion fails. This means that the given bundle does not contain a ProviderGetCredentialRequest. The bundle should be constructed and retrieved from asBundle itself and never be created from scratch to avoid the failure.
getBiometricPromptResult
public final BiometricPromptResult getBiometricPromptResult()
the result of a Biometric Prompt authentication flow, that is propagated to the provider if the provider requested for androidx.credentials.CredentialManager to handle the authentication flow
getCallingAppInfo
public final @NonNull CallingAppInfo getCallingAppInfo()
information pertaining to the calling application
getCredentialOptions
public final @NonNull List<@NonNull CredentialOption> getCredentialOptions()
the list of credential retrieval options containing the required parameters, expected to contain a single CredentialOption when this request is retrieved from the android.app.Activity invoked by the android.app.PendingIntent set on a PasswordCredentialEntry or a PublicKeyCredentialEntry, or expected to contain multiple CredentialOption when this request is retrieved from the android.app.Activity invoked by the android.app.PendingIntent set on a RemoteEntry
Extension functions
ProviderGetCredentialRequestKt.getSelectedCredentialSet
public final SelectedCredentialSet ProviderGetCredentialRequestKt.getSelectedCredentialSet(
@NonNull ProviderGetCredentialRequest receiver
)
Returns credential set selected by the user.
A null return means that the credential user case isn't registry based. In other words, it means the credentials weren't registered through the RegistryManager.registerCredentials API.
For how to handle a user selection and extract the ProviderGetCredentialRequest containing the selection information, see RegistryManager.ACTION_GET_CREDENTIAL.
ProviderGetCredentialRequestKt.getSelectedEntryId
public final String ProviderGetCredentialRequestKt.getSelectedEntryId(
@NonNull ProviderGetCredentialRequest receiver
)
Returns the id of the entry selected by the user. For example, for a digital credential entry, this maps to the corresponding entry's DigitalCredentialEntry.id.
A null return means that entry ID isn't supported for the given type of the use case at all. For example, a androidx.credentials.provider.PasswordCredentialEntry does not have an id property and so this getter will return null if the selected entry was a password credential.
For how to handle a user selection and extract the ProviderGetCredentialRequest containing the selection information, see RegistryManager.ACTION_GET_CREDENTIAL.