GoogleIdTokenCredential

class GoogleIdTokenCredential : CustomCredential


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

Throws
java.lang.NullPointerException

If any of id or idToken is null.

java.lang.IllegalArgumentException

If any of id or idToken is empty, or if the idToken is malformed or cannot be parsed.

Summary

Nested types

A builder for GoogleIdTokenCredential

Constants

const String

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

const String

A constant represents the type of Google ID Token Credential.

const String

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

Public companion functions

GoogleIdTokenCredential

Public constructors

GoogleIdTokenCredential(
    id: String,
    idToken: String,
    displayName: String?,
    familyName: String?,
    givenName: String?,
    profilePictureUri: Uri?,
    phoneNumber: String?
)

Public properties

String?

display name to show on the entry.

String?

The user's email address, parsed from idToken.

String?

user's family name.

String?

user's given name.

String

This property is deprecated. Use uniqueId for the stable user identifier, or email for the user's email address.

String

user's Google ID Token.

String?

This property is deprecated. Phone number will no longer be supported.

Uri?

user's profile picture uri.

String

The user's unique Google account ID, parsed from idToken.

Constants

BUNDLE_KEY_GOOGLE_ID_TOKEN_SUBTYPE

const val BUNDLE_KEY_GOOGLE_ID_TOKEN_SUBTYPEString

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

const val TYPE_GOOGLE_ID_TOKEN_CREDENTIALString

A constant represents the type of Google ID Token Credential.

TYPE_GOOGLE_ID_TOKEN_SIWG_CREDENTIAL

const val TYPE_GOOGLE_ID_TOKEN_SIWG_CREDENTIALString

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

Public companion functions

createFrom

fun createFrom(data: Bundle): GoogleIdTokenCredential

Public constructors

GoogleIdTokenCredential

GoogleIdTokenCredential(
    id: String,
    idToken: String,
    displayName: String?,
    familyName: String?,
    givenName: String?,
    profilePictureUri: Uri?,
    phoneNumber: String?
)

Public properties

displayName

val displayNameString?

display name to show on the entry.

email

val emailString?

The user's email address, parsed from idToken.

familyName

val familyNameString?

user's family name.

givenName

val givenNameString?

user's given name.

id

val idString

DEPRECATED the email address associated with user's Google Account.

idToken

val idTokenString

user's Google ID Token.

phoneNumber

val phoneNumberString?

DEPRECATED user's stored phone number.

profilePictureUri

val profilePictureUriUri?

user's profile picture uri.

uniqueId

val uniqueIdString

The user's unique Google account ID, parsed from idToken.