public static final class

CredentialRequest.Builder

extends Object
java.lang.Object
   ↳ com.google.android.gms.auth.api.credentials.CredentialRequest.Builder

Summary

Public Constructors
CredentialRequest.Builder()
Public Methods
CredentialRequest build()
Builds a CredentialRequest.
CredentialRequest.Builder setAccountTypes(String... accountTypes)
Sets the account types (identity providers) that are accepted by this application.
CredentialRequest.Builder setCredentialHintPickerConfig(CredentialPickerConfig config)
Sets the configuration for credential hint picker.
CredentialRequest.Builder setCredentialPickerConfig(CredentialPickerConfig config)
Sets the configuration for credential picker.
CredentialRequest.Builder setIdTokenNonce(String idTokenNonce)
Specify a nonce value that should be included in any generated ID token for this request.
CredentialRequest.Builder setIdTokenRequested(boolean idTokenRequested)
Specify whether an ID token should be acquired for retrieved credentials or hints, if available for the credential identifier.
CredentialRequest.Builder setPasswordLoginSupported(boolean passwordLoginSupported)
Enables returning credentials with a password, that is verified by the application.
CredentialRequest.Builder setServerClientId(String serverClientId)
Specify the server client ID for the backend associated with this app.
CredentialRequest.Builder setSupportsPasswordLogin(boolean supportsPasswordLogin)
This method is deprecated. Use setPasswordLoginSupported(boolean).
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public CredentialRequest.Builder ()

Public Methods

public CredentialRequest build ()

Builds a CredentialRequest.

Returns
CredentialRequest

public CredentialRequest.Builder setAccountTypes (String... accountTypes)

Sets the account types (identity providers) that are accepted by this application. It is strongly recommended that the strings listed in IdentityProviders be used for the most common identity providers, and strings representing the login domain of the identity provider be used for any others which are not listed.

Parameters
accountTypes String: The list of account types (identity providers) supported by the app. typically in the form of the associated login domain for each identity provider.
Returns
CredentialRequest.Builder

public CredentialRequest.Builder setCredentialHintPickerConfig (CredentialPickerConfig config)

Sets the configuration for credential hint picker.

Parameters
config CredentialPickerConfig
Returns
CredentialRequest.Builder

public CredentialRequest.Builder setCredentialPickerConfig (CredentialPickerConfig config)

Sets the configuration for credential picker.

Parameters
config CredentialPickerConfig
Returns
CredentialRequest.Builder

public CredentialRequest.Builder setIdTokenNonce (String idTokenNonce)

Specify a nonce value that should be included in any generated ID token for this request.

Parameters
idTokenNonce String
Returns
CredentialRequest.Builder

public CredentialRequest.Builder setIdTokenRequested (boolean idTokenRequested)

Specify whether an ID token should be acquired for retrieved credentials or hints, if available for the credential identifier. This is disabled by default; enable this if your app can consume ID tokens as a more secure alternative to passwords.

Parameters
idTokenRequested boolean
Returns
CredentialRequest.Builder

public CredentialRequest.Builder setPasswordLoginSupported (boolean passwordLoginSupported)

Enables returning credentials with a password, that is verified by the application.

Parameters
passwordLoginSupported boolean
Returns
CredentialRequest.Builder

public CredentialRequest.Builder setServerClientId (String serverClientId)

Specify the server client ID for the backend associated with this app. If a Google ID token can be generated for a retrieved credential or hint, and the specified server client ID is correctly configured to be associated with the app, then it will be used as the audience of the generated token. If a null value is specified, the default audience will be used for the generated ID token.

Parameters
serverClientId String
Returns
CredentialRequest.Builder

public CredentialRequest.Builder setSupportsPasswordLogin (boolean supportsPasswordLogin)

This method is deprecated.
Use setPasswordLoginSupported(boolean).

Parameters
supportsPasswordLogin boolean
Returns
CredentialRequest.Builder