public abstract class

AuthorizeListener

extends Object
implements InteractiveListener<T, U, V>
java.lang.Object
   ↳ com.amazon.identity.auth.device.api.authorization.AuthorizeListener

Class Overview

This is the listener for AuthorizeRequest. Implement and register this listener using registerListener(InteractiveListener) to receive callbacks from the authorize(AuthorizeRequest) API.{@since 3.0 }

Summary

Public Constructors
AuthorizeListener()
Public Methods
final String getRequestType()
Do not call this API, it is for internal SDK usage only.
abstract void onCancel(AuthCancellation cancellation)
Will be called when the authorization flow is cancelled by the user.
abstract void onError(AuthError e)
Will be called for the following OAuth-related errors upon authorization failure: If the APIKey is incorrect, ERROR_ACCESS_DENIED will be returned.
final void onRequestCancel(Context context, InteractiveRequestRecord request, WorkflowCancellation cancellation)
Do not call this API, it is for internal SDK usage only.
final void onRequestCompletion(Context context, InteractiveRequestRecord request, Uri uri)
Do not call this API, it is for internal SDK usage only.
final void onRequestError(Context context, InteractiveRequestRecord request, Exception e)
Do not call this API, it is for internal SDK usage only.
abstract void onSuccess(AuthorizeResult result)
Will be called when a call to authorize(AuthorizeRequest) completes.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.amazon.identity.auth.device.api.CancellableListener
From interface com.amazon.identity.auth.device.api.Listener
From interface com.amazon.identity.auth.device.interactive.InteractiveAPI
From interface com.amazon.identity.auth.device.interactive.InteractiveListener

Public Constructors

public AuthorizeListener ()

Public Methods

public final String getRequestType ()

Do not call this API, it is for internal SDK usage only.

Returns
  • A non-null, unique, RFC 3986-safe string that identifies the kind of interactive request.

public abstract void onCancel (AuthCancellation cancellation)

Will be called when the authorization flow is cancelled by the user. Dismissal of the native browser before authorization is complete will not be detected.

Parameters
cancellation Describes the cancellation of the authorization flow.

public abstract void onError (AuthError e)

Will be called for the following OAuth-related errors upon authorization failure:

If the APIKey is incorrect, ERROR_ACCESS_DENIED will be returned.

Any other possible OAuth-related errors will be encapsulated in a ERROR_SERVER_REPSONSE.

Parameters
e The error object describing the failure.

public final void onRequestCancel (Context context, InteractiveRequestRecord request, WorkflowCancellation cancellation)

Do not call this API, it is for internal SDK usage only.

public final void onRequestCompletion (Context context, InteractiveRequestRecord request, Uri uri)

Do not call this API, it is for internal SDK usage only.

public final void onRequestError (Context context, InteractiveRequestRecord request, Exception e)

Do not call this API, it is for internal SDK usage only.

public abstract void onSuccess (AuthorizeResult result)

Will be called when a call to authorize(AuthorizeRequest) completes.

Parameters
result The data requested by AuthorizeRequest.