public class

GoogleSignInAccount

extends Object
java.lang.Object
   ↳ com.neomades.googlesignin.GoogleSignInAccount

Class Overview

Class that holds the basic account information of the signed in Google user.

Cross-Platform considerations

Available only for Android.

Summary

Public Methods
String getDisplayName()
Returns the display name of the signed in user; Can be null.
String getEmail()
Returns the email address of the signed in user if requestEmail() was configured; null otherwise.
String getFamilyName()
Returns the family name of the signed in user if you built your configuration; Can be null.
String getGivenName()
Returns the given name of the signed in user; Can be null.
String getId()
Returns the unique ID for the Google account; Can be null.
String getIdToken()
Returns an ID token that you can send to your server if requestIdToken(String) was configured; null otherwise.
String getServerAuthCode()
Returns a one-time server auth code to send to your web server which can be exchanged for access token and sometimes refresh token if #requestServerAuthCode(String) is configured; null otherwise.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public String getDisplayName ()

Returns the display name of the signed in user; Can be null. Not guaranteed to be present for all users, even when configured.

Returns
  • the display name of the signed in user

public String getEmail ()

Returns the email address of the signed in user if requestEmail() was configured; null otherwise. Applications should not key users by email address since a Google account's email address can change. Use getId() as a key instead.

Returns
  • the email address of the signed in user

public String getFamilyName ()

Returns the family name of the signed in user if you built your configuration; Can be null. Not guaranteed to be present for all users, even when configured.

Returns
  • the family name of the signed in user

public String getGivenName ()

Returns the given name of the signed in user; Can be null. Not guaranteed to be present for all users, even when configured.

Returns
  • the given name of the signed in user

public String getId ()

Returns the unique ID for the Google account; Can be null. This is the preferred unique key to use for a user record.

Returns
  • the unique ID for the Google account

public String getIdToken ()

Returns an ID token that you can send to your server if requestIdToken(String) was configured; null otherwise. ID token is a JSON Web Token signed by Google that can be used to identify a user to a backend.

Returns
  • an ID token that you can send to your server

public String getServerAuthCode ()

Returns a one-time server auth code to send to your web server which can be exchanged for access token and sometimes refresh token if #requestServerAuthCode(String) is configured; null otherwise.

Returns
  • a one-time server auth code to send to your web server