Class A3LSignInAccount
java.lang.Object
com.amazon.A3L.authentication.api.signin.A3LSignInAccount
Contains the details of currently Signed In Account details.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final <any>Creator used for fetching data from the parcel received by an activity -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintNeeded for ParcellingbooleanOverridden method to verify if the current A3LSignInObject and the one requested have same data.AccountA convenient wrapper forgetEmail()which returns anandroid.accounts.Accountobject.Returns the display name of the signed in user if you built your configuration starting from newA3LSignInOptions.Builder(A3LSignInOptions.DEFAULT_SIGN_IN) or withA3LSignInOptions.Builder.requestProfile()configured; null otherwise.getEmail()Returns the email address of the signed in user ifA3LSignInOptions.Builder.requestEmail()was configured; null otherwise.Returns the family name of the signed in user if you built your configuration starting from newA3LSignInOptions.Builder(A3LSignInOptions.DEFAULT_SIGN_IN) or withA3LSignInOptions.Builder.requestProfile()configured; null otherwise.Returns the given name of the signed in user if you built your configuration starting from newA3LSignInOptions.Builder(A3LSignInOptions.DEFAULT_SIGN_IN) or withA3LSignInOptions.Builder.requestProfile()configured; null otherwise.Returns all scopes that have been authorized to your application.getId()Returns the unique ID for the Google account if you built your configuration starting from newA3LSignInOptions.Builder(A3LSignInOptions.DEFAULT_SIGN_IN) or withA3LSignInOptions.Builder.requestId()configured; null otherwise.Returns an ID token that you can send to your server ifA3LSignInOptions.Builder.requestIdToken(String)was configured; null otherwise.UriReturns the photo url of the signed in user if you built your configuration starting from newA3LSignInOptions.Builder(A3LSignInOptions.DEFAULT_SIGN_IN) or withA3LSignInOptions.Builder.requestProfile()configured; null otherwise.Returns all scopes that have been requested by your application.inthashCode()voidwriteToParcel(Parcel parcel, int flags) Helps in parcelling the Account.
-
Field Details
-
CREATOR
public static final <any> CREATORCreator 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
Returns the display name of the signed in user if you built your configuration starting from newA3LSignInOptions.Builder(A3LSignInOptions.DEFAULT_SIGN_IN) or withA3LSignInOptions.Builder.requestProfile()configured; null otherwise. Not guaranteed to be present for all users, even when configured.- Returns:
- String: Display Name of the account
-
getEmail
Returns the email address of the signed in user ifA3LSignInOptions.Builder.requestEmail()was configured; null otherwise. Applications should not key users by email address since a Google account's email address can change. UsegetId()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 tokenA3LSignInOptions.Builder.requestIdToken(String), which can be securely validated on the server- Returns:
- String: Email of the account
-
getFamilyName
Returns the family name of the signed in user if you built your configuration starting from newA3LSignInOptions.Builder(A3LSignInOptions.DEFAULT_SIGN_IN) or withA3LSignInOptions.Builder.requestProfile()configured; null otherwise. Not guaranteed to be present for all users, even when configured.- Returns:
- String: Family Name of the account
-
getGivenName
Returns the given name of the signed in user if you built your configuration starting from newA3LSignInOptions.Builder(A3LSignInOptions.DEFAULT_SIGN_IN) or withA3LSignInOptions.Builder.requestProfile()configured; null otherwise. Not guaranteed to be present for all users, even when configured.- Returns:
- String: Given Name of the account
-
getId
Returns the unique ID for the Google account if you built your configuration starting from newA3LSignInOptions.Builder(A3LSignInOptions.DEFAULT_SIGN_IN) or withA3LSignInOptions.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 tokenA3LSignInOptions.Builder.requestIdToken(String), which can be securely validated on the server.- Returns:
- String: Id representing the Google Account
-
getIdToken
Returns an ID token that you can send to your server ifA3LSignInOptions.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 newA3LSignInOptions.Builder(A3LSignInOptions.DEFAULT_SIGN_IN) or withA3LSignInOptions.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 forgetEmail()which returns anandroid.accounts.Accountobject.- Returns:
- account:
android.accounts.Account
-
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
Returns all scopes that have been authorized to your application. This can be a larger set than what you have requested viaA3LSignInOptionslarger 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 A3LSignInAccountflags- : Additional flags about how the object should be written.
-
equals
Overridden method to verify if the current A3LSignInObject and the one requested have same data. -
hashCode
public int hashCode()
-