GetCredentialRequest.Builder


public final class GetCredentialRequest.Builder


A builder for GetCredentialRequest.

Summary

Public constructors

Public methods

final @NonNull GetCredentialRequest.Builder

Adds a specific type of CredentialOption.

final @NonNull GetCredentialRequest

Builds a GetCredentialRequest.

final @NonNull GetCredentialRequest.Builder

Sets the list of CredentialOption.

final @NonNull GetCredentialRequest.Builder

Sets the origin of a different application if the request is being made on behalf of that application.

final @NonNull GetCredentialRequest.Builder
setPreferIdentityDocUi(boolean preferIdentityDocUi)

Sets the Boolean preferIdentityDocUi to true if the requester wants to prefer using a UI suited for Identity Documents like mDocs, Driving License etc.

final @NonNull GetCredentialRequest.Builder
setPreferImmediatelyAvailableCredentials(
    boolean preferImmediatelyAvailableCredentials
)

Sets whether you prefer the operation to return immediately when there is no available credentials instead of falling back to discovering remote options.

final @NonNull GetCredentialRequest.Builder

Sets service ComponentName from which the Credential Selector UI will pull its label and icon to render top level branding.

Public constructors

Builder

Added in 1.2.0
public Builder()

Public methods

addCredentialOption

Added in 1.2.0
public final @NonNull GetCredentialRequest.Builder addCredentialOption(@NonNull CredentialOption credentialOption)

Adds a specific type of CredentialOption.

build

Added in 1.2.0
public final @NonNull GetCredentialRequest build()

Builds a GetCredentialRequest.

setCredentialOptions

public final @NonNull GetCredentialRequest.Builder setCredentialOptions(
    @NonNull List<@NonNull CredentialOption> credentialOptions
)

Sets the list of CredentialOption.

setOrigin

Added in 1.2.0
public final @NonNull GetCredentialRequest.Builder setOrigin(@NonNull String origin)

Sets the origin of a different application if the request is being made on behalf of that application. For API level >=34, setting a non-null value for this parameter, will throw a SecurityException if android.permission.CREDENTIAL_MANAGER_SET_ORIGIN is not present.

setPreferIdentityDocUi

Added in 1.2.0
public final @NonNull GetCredentialRequest.Builder setPreferIdentityDocUi(boolean preferIdentityDocUi)

Sets the Boolean preferIdentityDocUi to true if the requester wants to prefer using a UI suited for Identity Documents like mDocs, Driving License etc.

setPreferImmediatelyAvailableCredentials

Added in 1.2.0
public final @NonNull GetCredentialRequest.Builder setPreferImmediatelyAvailableCredentials(
    boolean preferImmediatelyAvailableCredentials
)

Sets whether you prefer the operation to return immediately when there is no available credentials instead of falling back to discovering remote options. The default value is false.

setPreferUiBrandingComponentName

Added in 1.2.0
public final @NonNull GetCredentialRequest.Builder setPreferUiBrandingComponentName(ComponentName component)

Sets service ComponentName from which the Credential Selector UI will pull its label and icon to render top level branding. Your app must have the permission android.permission.CREDENTIAL_MANAGER_SET_ALLOWED_PROVIDERS to specify this, or it would not take effect. Notice that this bit may not take effect for Android API level 33 and below, depending on the pre-34 provider(s) you have chosen.