public final class

AuthorizeResult

extends Object
implements Parcelable
java.lang.Object
   ↳ com.amazon.identity.auth.device.api.authorization.AuthorizeResult

Class Overview

Returned as a result on successful completion of the following APIs:

AuthorizeResult will always return an authorization grant, either in the form of an access token or authorization code, depending on what was requested.{@since 3.0 }

Summary

[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<AuthorizeResult> CREATOR
Public Methods
int describeContents()
boolean equals(Object obj)
String getAccessToken()
An access token will be returned by either authorize(AuthorizeRequest) when called with with AuthorizeRequest.GrantType specified as ACCESS_TOKEN, or by getToken(Context, Scope[], com.amazon.identity.auth.device.api.Listener).{@since 3.0 }
String getAuthorizationCode()
An authorization code will be returned if authorize(AuthorizeRequest) was called with AuthorizeRequest.GrantType specified as AUTHORIZATION_CODE.{@since 3.0 }
String getClientId()
Returns the client ID that is encoded within the API key used by your app to integrate with the Login with Amazon Android SDK.
String getRedirectURI()
Returns the redirect_uri parameter which is required to do the exchange of code with access token and refresh token.
User getUser()
If authorize(AuthorizeRequest) was called with shouldReturnUserData() set to true (it is true by default), then a User object will be available from this method.{@since 3.0 }
int hashCode()
void writeToParcel(Parcel dest, int flags)
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Fields

public static final Creator<AuthorizeResult> CREATOR

Public Methods

public int describeContents ()

public boolean equals (Object obj)

public String getAccessToken ()

An access token will be returned by either authorize(AuthorizeRequest) when called with with AuthorizeRequest.GrantType specified as ACCESS_TOKEN, or by getToken(Context, Scope[], com.amazon.identity.auth.device.api.Listener).{@since 3.0 }

Returns
  • The access token as a string if access token was requested, otherwise null.

public String getAuthorizationCode ()

An authorization code will be returned if authorize(AuthorizeRequest) was called with AuthorizeRequest.GrantType specified as AUTHORIZATION_CODE.{@since 3.0 }

Returns
  • The authorization code as a string if authorization code was requested, otherwise null.

public String getClientId ()

Returns the client ID that is encoded within the API key used by your app to integrate with the Login with Amazon Android SDK. This client Id is your client identifier that the Login with Amazon Android SDK uses to authorize customers for your application. If you are requesting an authorization code in the authorize(AuthorizeRequest) call, you must call this method in the onSuccess handler of your AuthorizeListener in order to get the client ID, which is a parameter required to do the exchange of code for access token and refresh token.{@since 3.0 }

Returns
  • String - The "clientId" associated with the API key

public String getRedirectURI ()

Returns the redirect_uri parameter which is required to do the exchange of code with access token and refresh token. If you are requesting an authorization code in the authorize(AuthorizeRequest) call, you must call this API in the onSuccess handler of your AuthorizationListener to get the redirect_uri.{@since 3.0 }

Returns
  • String - "redirect_uri" which is of the format "amzn://"

public User getUser ()

If authorize(AuthorizeRequest) was called with shouldReturnUserData() set to true (it is true by default), then a User object will be available from this method.{@since 3.0 }

Returns
  • The User object if one was requested, otherwise null.

public int hashCode ()

public void writeToParcel (Parcel dest, int flags)