ProviderCreateCredentialRequest


public final class ProviderCreateCredentialRequest


Final request received by the provider after the user has selected a given CreateEntry on the UI.

This request contains the actual request coming from the calling app, and the application information associated with the calling app.

Throws
kotlin.NullPointerException

If callingRequest, or callingAppInfo is null

Note : Credential providers are not expected to utilize the constructor in this class for any production flow. This constructor must only be used for testing purposes.

Summary

Public constructors

ProviderCreateCredentialRequest(
    @NonNull CreateCredentialRequest callingRequest,
    @NonNull CallingAppInfo callingAppInfo,
    BiometricPromptResult biometricPromptResult
)

constructs an instance of ProviderCreateCredentialRequest

Public methods

static final @NonNull Bundle

Helper method to convert the given request to a parcelable Bundle, in case the instance needs to be sent across a process.

static final @NonNull ProviderCreateCredentialRequest
@RequiresApi(value = 23)
fromBundle(@NonNull Bundle bundle)

Helper method to convert a Bundle retrieved through asBundle, back to an instance of ProviderCreateCredentialRequest.

final BiometricPromptResult

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

final @NonNull CallingAppInfo

information pertaining to the calling app making the request

final @NonNull CreateCredentialRequest

the complete CreateCredentialRequest coming from the calling app that is requesting for credential creation

Public constructors

ProviderCreateCredentialRequest

Added in 1.5.0-alpha05
public ProviderCreateCredentialRequest(
    @NonNull CreateCredentialRequest callingRequest,
    @NonNull CallingAppInfo callingAppInfo,
    BiometricPromptResult biometricPromptResult
)

constructs an instance of ProviderCreateCredentialRequest

Public methods

asBundle

Added in 1.5.0-alpha05
@RequiresApi(value = 23)
public static final @NonNull Bundle asBundle(@NonNull ProviderCreateCredentialRequest 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

Added in 1.5.0-alpha05
@RequiresApi(value = 23)
public static final @NonNull ProviderCreateCredentialRequest fromBundle(@NonNull Bundle bundle)

Helper method to convert a Bundle retrieved through asBundle, back to an instance of ProviderCreateCredentialRequest.

Throws IllegalArgumentException if the conversion fails. This means that the given bundle does not contain a ProviderCreateCredentialRequest. The bundle should be constructed and retrieved from asBundle itself and never be created from scratch to avoid the failure.

getBiometricPromptResult

Added in 1.5.0-alpha05
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

Added in 1.2.0
public final @NonNull CallingAppInfo getCallingAppInfo()

information pertaining to the calling app making the request

getCallingRequest

Added in 1.2.0
public final @NonNull CreateCredentialRequest getCallingRequest()

the complete CreateCredentialRequest coming from the calling app that is requesting for credential creation