GetSignInWithGoogleOption

public final class GetSignInWithGoogleOption extends GetCustomCredentialOption


A request to retrieve user's Google ID Token from an explicit 'Sign in with Google' button.

Credential Provider that wishes to serve this credential type must check if the incoming GetCustomCredentialOption has type GoogleIdTokenCredential.TYPE_GOOGLE_ID_TOKEN_CREDENTIAL and the corresponding requestData and candidateQueryData must have the key GoogleIdTokenCredential.BUNDLE_KEY_GOOGLE_ID_TOKEN_SUBTYPE with the value set as GoogleIdTokenCredential.TYPE_GOOGLE_ID_TOKEN_SIWG_CREDENTIAL

Throws
java.lang.IllegalArgumentException java.lang.IllegalArgumentException

If serverClientId is empty

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

If any error encountered in creating GetSignInWithGoogleOption from bundle.

Summary

Nested types

Builder class for GetSignInWithGoogleOption

Public constructors

GetSignInWithGoogleOption(
    @NonNull String serverClientId,
    String hostedDomainFilter,
    String nonce
)

Public methods

static final @NonNull GetSignInWithGoogleOption

Helper function to create GetSignInWithGoogleOption out of given Bundle.

final String

hosted domain filter (e.g. myuniveristy.edu)

final String

the nonce to use during ID token generation

final @NonNull String

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

Public constructors

GetSignInWithGoogleOption

public GetSignInWithGoogleOption(
    @NonNull String serverClientId,
    String hostedDomainFilter,
    String nonce
)

Public methods

createFrom

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

Helper function to create GetSignInWithGoogleOption out of given Bundle.

Parameters
@NonNull Bundle data

Bunble that contains all the necessary information about GetSignInWithGoogleOption.

getHostedDomainFilter

public final String getHostedDomainFilter()

hosted domain filter (e.g. myuniveristy.edu)

getNonce

public final String getNonce()

the nonce to use during ID token generation

getServerClientId

public final @NonNull String getServerClientId()

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