Stay organized with collections Save and categorize content based on your preferences.

GetCredentialRequest

public final class GetCredentialRequest


Encapsulates a request to get a user credential.

An application can construct such a request by adding one or more types of CredentialOption, and then call CredentialManager.getCredential to launch framework UI flows to allow the user to consent to using a previously saved credential for the given application.

Throws
kotlin.IllegalArgumentException kotlin.IllegalArgumentException

If credentialOptions is empty

Summary

Nested types

public final class GetCredentialRequest.Builder

A builder for GetCredentialRequest.

Public constructors

GetCredentialRequest(
    @NonNull List<@NonNull CredentialOption> credentialOptions,
    String origin
)

Public methods

final @NonNull List<@NonNull CredentialOption>

the list of CredentialOption from which the user can choose one to authenticate to the app

final String

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

Public constructors

GetCredentialRequest

public GetCredentialRequest(
    @NonNull List<@NonNull CredentialOption> credentialOptions,
    String origin
)

Public methods

getCredentialOptions

public final @NonNull List<@NonNull CredentialOptiongetCredentialOptions()

the list of CredentialOption from which the user can choose one to authenticate to the app

getOrigin

public final String getOrigin()

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.