GetGoogleIdOption

public final class GetGoogleIdOption extends GetCustomCredentialOption


A request to retrieve user's Google ID Token.

Throws
java.lang.IllegalArgumentException java.lang.IllegalArgumentException

If serverClientId is empty

java.lang.IllegalArgumentException java.lang.IllegalArgumentException

If both filterByAuthorizedAccounts and requestVerifiedPhoneNumber are true.

com.google.android.libraries.identity.googleid.GoogleIdTokenParsingException com.google.android.libraries.identity.googleid.GoogleIdTokenParsingException

If any error encountered in creating GetGoogleIdOption from bundle.

Summary

Nested types

public final class GetGoogleIdOption.Builder

A Builder for GetGoogleIdOption.

public static class GetGoogleIdOption.Companion

Public constructors

GetGoogleIdOption(
    @NonNull String serverClientId,
    String nonce,
    boolean filterByAuthorizedAccounts,
    String linkedServiceId,
    List<@NonNull String> idTokenDepositionScopes,
    boolean requestVerifiedPhoneNumber,
    boolean autoSelectEnabled
)

Public methods

static final @NonNull GetGoogleIdOption

Helper function to create GetGoogleIdOption out of given Bundle.

final boolean

sets the auto-select behavior in the request. sign-ups.

final boolean

whether to only allow the user to select from Google accounts that are already authorized to sign in to your application, default value is true

final List<@NonNull String>

Oauth scopes that Google will need to deposit a Google ID token to your application's backend server.

final String

service ID used when linking accounts to a Google account

final String

the nonce to use during ID token generation

final boolean

whether to request for a verified phone number during sign-ups.

final @NonNull String

the client ID of the server to which the ID token will be issued

Public constructors

GetGoogleIdOption

public GetGoogleIdOption(
    @NonNull String serverClientId,
    String nonce,
    boolean filterByAuthorizedAccounts,
    String linkedServiceId,
    List<@NonNull String> idTokenDepositionScopes,
    boolean requestVerifiedPhoneNumber,
    boolean autoSelectEnabled
)

Public methods

createFrom

public static final @NonNull GetGoogleIdOption createFrom(@NonNull Bundle data)

Helper function to create GetGoogleIdOption out of given Bundle.

Parameters
@NonNull Bundle data

Bunble that contains all the necessary information about GetGoogleIdOption.

getAutoSelectEnabled

public final boolean getAutoSelectEnabled()

sets the auto-select behavior in the request. sign-ups.

getFilterByAuthorizedAccounts

public final boolean getFilterByAuthorizedAccounts()

whether to only allow the user to select from Google accounts that are already authorized to sign in to your application, default value is true

getIdTokenDepositionScopes

public final List<@NonNull StringgetIdTokenDepositionScopes()

Oauth scopes that Google will need to deposit a Google ID token to your application's backend server. This is optional and can be set to null. Only required if Google requires particular scopes to be able to deposit the ID token.

getLinkedServiceId

public final String getLinkedServiceId()

service ID used when linking accounts to a Google account

getNonce

public final String getNonce()

the nonce to use during ID token generation

getRequestVerifiedPhoneNumber

public final boolean getRequestVerifiedPhoneNumber()

whether to request for a verified phone number during sign-ups.

getServerClientId

public final @NonNull String getServerClientId()

the client ID of the server to which the ID token will be issued