Class A3LSignInAccount

java.lang.Object
com.amazon.A3L.authentication.api.signin.A3LSignInAccount

public class A3LSignInAccount extends Object
Contains the details of currently Signed In Account details.
  • Field Details

    • CREATOR

      public static final <any> CREATOR
      Creator used for fetching data from the parcel received by an activity
  • Constructor Details

    • A3LSignInAccount

      public A3LSignInAccount(@NonNull JSONObject accountDetails) throws JSONException
      Throws:
      JSONException
  • Method Details

    • getDisplayName

      public String getDisplayName()
      Returns the display name of the signed in user if you built your configuration starting from new A3LSignInOptions.Builder(A3LSignInOptions.DEFAULT_SIGN_IN) or with A3LSignInOptions.Builder.requestProfile() configured; null otherwise. Not guaranteed to be present for all users, even when configured.
      Returns:
      String: Display Name of the account
    • getEmail

      public 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
    • getFamilyName

      public String getFamilyName()
      Returns the family name of the signed in user if you built your configuration starting from new A3LSignInOptions.Builder(A3LSignInOptions.DEFAULT_SIGN_IN) or with A3LSignInOptions.Builder.requestProfile() configured; null otherwise. Not guaranteed to be present for all users, even when configured.
      Returns:
      String: Family Name of the account
    • getGivenName

      public String getGivenName()
      Returns the given name of the signed in user if you built your configuration starting from new A3LSignInOptions.Builder(A3LSignInOptions.DEFAULT_SIGN_IN) or with A3LSignInOptions.Builder.requestProfile() configured; null otherwise. Not guaranteed to be present for all users, even when configured.
      Returns:
      String: Given Name of the account
    • getId

      public String getId()
      Returns the unique ID for the Google account if you built your configuration starting from new A3LSignInOptions.Builder(A3LSignInOptions.DEFAULT_SIGN_IN) or with A3LSignInOptions.Builder.requestId() configured; null otherwise. This is the preferred unique key to use for a user record. 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: Id representing the Google Account
    • getIdToken

      public 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
    • getPhotoUrl

      public Uri getPhotoUrl()
      Returns the photo url of the signed in user if you built your configuration starting from new A3LSignInOptions.Builder(A3LSignInOptions.DEFAULT_SIGN_IN) or with A3LSignInOptions.Builder.requestProfile() configured; null otherwise. Not guaranteed to be present for all users, even when configured.
      Returns:
      Uri: Display Picture URI
    • getAccount

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

      public 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 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
      Returns:
      int: 0
    • writeToParcel

      public void writeToParcel(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
      Parameters:
      parcel - : Parcel consisting of the A3LSignInAccount
      flags - : Additional flags about how the object should be written.
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object