public interface

AuthorizationListener

implements CancellableListener<T, U, V> APIListener
com.amazon.identity.auth.device.authorization.api.AuthorizationListener

Class Overview

A callback interface used by AmazonAuthorizationManager authorize API.

Summary

Public Methods
abstract void onCancel(Bundle cause)
The user canceled the authorization flow
abstract void onError(AuthError e)
There was an error during the API execution.
abstract void onSuccess(Bundle response)
The API executed successfully.
[Expand]
Inherited Methods
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.shared.APIListener

Public Methods

public abstract void onCancel (Bundle cause)

The user canceled the authorization flow

Parameters
cause the cause of the cancellation. There are 2 possible causes of a cancellation:
  1. Integer value at bundle key AuthzConstants.BUNDLE_KEY.CAUSE_ID.val is AuthzConstants.CAUSE_FAILED_AUTHENTICATION. This means that the cancellation happened because the user failed to sign in to Amazon Additional info may be found in string AuthzConstants.BUNDLE_KEY.ON_CANCEL_TYPE.val and string AuthzConstants.BUNDLE_KEY.ON_CANCEL_DESCRIPTION.val
  2. Integer value at bundle key AuthzConstants.BUNDLE_KEY.CAUSE_ID.val is AuthzConstants.CAUSE_REJECTED_SCOPES. This means that the app doesn't have access to some of the requested scopes, and these scopes are included as a String[] array stored in the bundle at key AuthzConstants.BUNDLE_KEY.REJECTED_SCOPE_LIST.val

public abstract void onError (AuthError e)

There was an error during the API execution.

Parameters
e The error that the developer has to handle.
See Also

public abstract void onSuccess (Bundle response)

The API executed successfully.

Parameters
response The bundle containing relevant information.