GoogleIdTokenCredential

public final class GoogleIdTokenCredential extends CustomCredential


Represents the user's Google ID Token granted by the user for app sign-in.

Throws
java.lang.NullPointerException java.lang.NullPointerException

If any of id or idToken is null.

java.lang.IllegalArgumentException java.lang.IllegalArgumentException

If any of id or idToken is empty

Summary

Nested types

A builder for GoogleIdTokenCredential

Constants

static final @NonNull String

The constant used as a key in the SignInWithGoogleOption request and candidate data bundles, to distinguish SignInWithGoogleOption from GetGoogleIdTokenOption.

static final @NonNull String

A constant represents the type of Google ID Token Credential.

static final @NonNull String

A constant represents the type of Google ID Token Credential rerieved from SiWG button.

Public constructors

GoogleIdTokenCredential(
    @NonNull String id,
    @NonNull String idToken,
    String displayName,
    String familyName,
    String givenName,
    Uri profilePictureUri,
    String phoneNumber
)

Public methods

static final @NonNull GoogleIdTokenCredential
final String

display name to show on the entry.

final String

user's family name.

final String

user's given name.

final @NonNull String

the email address associated with user's Google Account.

final @NonNull String

user's Google ID Toekn.

final String

user's stored phone number.

final Uri

user's profile picture uri.

Inherited methods

From androidx.credentials.Credential

Constants

BUNDLE_KEY_GOOGLE_ID_TOKEN_SUBTYPE

public static final @NonNull String BUNDLE_KEY_GOOGLE_ID_TOKEN_SUBTYPE

The constant used as a key in the SignInWithGoogleOption request and candidate data bundles, to distinguish SignInWithGoogleOption from GetGoogleIdTokenOption. While both aforementioned options have the type TYPE_GOOGLE_ID_TOKEN_CREDENTIAL, SignInWithGoogleOption has a sub-type TYPE_GOOGLE_ID_TOKEN_SIWG_CREDENTIAL encoded against this key.

TYPE_GOOGLE_ID_TOKEN_CREDENTIAL

public static final @NonNull String TYPE_GOOGLE_ID_TOKEN_CREDENTIAL

A constant represents the type of Google ID Token Credential.

TYPE_GOOGLE_ID_TOKEN_SIWG_CREDENTIAL

public static final @NonNull String TYPE_GOOGLE_ID_TOKEN_SIWG_CREDENTIAL

A constant represents the type of Google ID Token Credential rerieved from SiWG button.

Public constructors

GoogleIdTokenCredential

public GoogleIdTokenCredential(
    @NonNull String id,
    @NonNull String idToken,
    String displayName,
    String familyName,
    String givenName,
    Uri profilePictureUri,
    String phoneNumber
)

Public methods

createFrom

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

getDisplayName

public final String getDisplayName()

display name to show on the entry.

getFamilyName

public final String getFamilyName()

user's family name.

getGivenName

public final String getGivenName()

user's given name.

getId

public final @NonNull String getId()

the email address associated with user's Google Account.

getIdToken

public final @NonNull String getIdToken()

user's Google ID Toekn.

getPhoneNumber

public final String getPhoneNumber()

user's stored phone number.

getProfilePictureUri

public final Uri getProfilePictureUri()

user's profile picture uri.