Class A3LSignInAccount

  • All Implemented Interfaces:
    android.os.Parcelable

    public class A3LSignInAccount
    extends java.lang.Object
    implements android.os.Parcelable
    Contains the details of currently Signed In Account details.
    • Field Detail

      • CREATOR

        public static final android.os.Parcelable.Creator<A3LSignInAccount> CREATOR
        Creator used for fetching data from the parcel received by an activity
    • Constructor Detail

      • A3LSignInAccount

        public A3LSignInAccount​(@NonNull
                                org.json.JSONObject accountDetails)
                         throws org.json.JSONException
        Throws:
        org.json.JSONException
    • Method Detail

      • getEmail

        public java.lang.String getEmail()
        Returns the email address of the signed in user if A3LSignInOptions.Builder.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. Important: Do not use this returned email address to communicate the currently signed in user to your backend server. Instead, send an ID token A3LSignInOptions.Builder.requestIdToken(String), which can be securely validated on the server
        Returns:
        String: Email of the account
      • getIdToken

        public java.lang.String getIdToken()
        Returns an ID token that you can send to your server if A3LSignInOptions.Builder.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:
        String: Id token of the user
      • getAccount

        public android.accounts.Account getAccount()
        A convenient wrapper for getEmail() which returns an Account object.
        Returns:
        account: Account
      • getRequestedScopes

        public java.util.Set<Scope> getRequestedScopes()
        Returns all scopes that have been requested by your application.
        Returns:
        Set: A set of all scopes those were requested by the app.
      • getGrantedScopes

        public java.util.Set<Scope> getGrantedScopes()
        Returns all scopes that have been authorized to your application. This can be a larger set than what you have requested via A3LSignInOptions larger due to other scope handling logic.
        Returns:
        Set: A set of all scopes those were granted to the app.
      • describeContents

        public int describeContents()
        Needed for Parcelling
        Specified by:
        describeContents in interface android.os.Parcelable
        Returns:
        int: 0
      • writeToParcel

        public void writeToParcel​(android.os.Parcel parcel,
                                  int flags)
        Helps in parcelling the Account. This lets the A3LSignInAccount object to be transferred between activities as needed. Flags values can be 0, PARCELABLE_WRITE_RETURN_VALUE or PARCELABLE_ELIDE_DUPLICATES
        Specified by:
        writeToParcel in interface android.os.Parcelable
        Parameters:
        parcel - : Parcel consisting of the A3LSignInAccount
        flags - : Additional flags about how the object should be written.
      • equals

        public boolean equals​(java.lang.Object obj)
        Overridden method to verify if the current A3LSignInObject and the one requested have same data.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - : A3LSignInAccount
        Returns:
        boolean: true if both objects have same information
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object