public final class LiAuthorizationException
extends java.lang.Exception
Modifier and Type | Class and Description |
---|---|
static class |
LiAuthorizationException.AuthorizationRequestErrors
Error codes related to failed authorization requests.
|
static class |
LiAuthorizationException.GeneralErrors
Error codes specific to AppAuth for Android, rather than those defined in the OAuth2 and
OpenID specifications.
|
static class |
LiAuthorizationException.RegistrationRequestErrors
Error codes related to failed registration requests.
|
static class |
LiAuthorizationException.TokenRequestErrors
Error codes related to failed token requests.
|
Modifier and Type | Field and Description |
---|---|
int |
code
The error code describing the class of problem encountered from the set defined in this
class.
|
java.lang.String |
error
The error string as it is found in the OAuth2 protocol.
|
java.lang.String |
errorDescription
The human readable error message associated with this exception, if available.
|
android.net.Uri |
errorUri
A URI identifying a human-readable web page with information about this error.
|
static java.lang.String |
EXTRA_EXCEPTION
The extra string that used to store an
LiAuthorizationException in an intent by
toIntent() . |
protected static java.lang.String |
KEY_CODE |
protected static java.lang.String |
KEY_ERROR |
protected static java.lang.String |
KEY_ERROR_DESCRIPTION |
protected static java.lang.String |
KEY_ERROR_URI |
protected static java.lang.String |
KEY_TYPE |
static java.lang.String |
PARAM_ERROR
The OAuth2 parameter used to indicate the type of error during an authorization or
token request.
|
static java.lang.String |
PARAM_ERROR_DESCRIPTION
The OAuth2 parameter used to provide a human readable description of the error which
occurred.
|
static java.lang.String |
PARAM_ERROR_URI
The OAuth2 parameter used to provide a URI to a human-readable page which describes the
error.
|
int |
type
The type of the error.
|
static int |
TYPE_GENERAL_ERROR
The error type used for all errors that are not specific to OAuth related responses.
|
static int |
TYPE_OAUTH_AUTHORIZATION_ERROR
The error type for OAuth specific errors on the authorization endpoint.
|
static int |
TYPE_OAUTH_REGISTRATION_ERROR
The error type for OAuth specific errors on the registration endpoint.
|
static int |
TYPE_OAUTH_TOKEN_ERROR
The error type for OAuth specific errors on the token endpoint.
|
static int |
TYPE_RESOURCE_SERVER_AUTHORIZATION_ERROR
The error type for authorization errors encountered out of band on the resource server.
|
Constructor and Description |
---|
LiAuthorizationException(int type,
int code,
java.lang.String error,
java.lang.String errorDescription,
android.net.Uri errorUri,
java.lang.Throwable rootCause)
Instantiates an authorization request with optional root cause information.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
|
static LiAuthorizationException |
fromIntent(android.content.Intent data)
Extracts an
LiAuthorizationException from an intent produced by toIntent() . |
static LiAuthorizationException |
fromJson(org.json.JSONObject json)
Reconstructs an
LiAuthorizationException from the JSON produced by
toJson() . |
static LiAuthorizationException |
fromJson(java.lang.String jsonStr)
Reconstructs an
LiAuthorizationException from the JSON produced by
toJsonString() . |
static LiAuthorizationException |
fromOAuthTemplate(LiAuthorizationException ex,
java.lang.String errorOverride,
java.lang.String errorDescriptionOverride,
android.net.Uri errorUriOverride)
Creates an exception based on one of the existing values defined in
LiAuthorizationException.AuthorizationRequestErrors or LiAuthorizationException.TokenRequestErrors , adding information
retrieved from OAuth error response. |
static LiAuthorizationException |
fromTemplate(LiAuthorizationException ex,
java.lang.Throwable rootCause)
Creates an exception based on one of the existing values defined in
LiAuthorizationException.GeneralErrors , LiAuthorizationException.AuthorizationRequestErrors or LiAuthorizationException.TokenRequestErrors ,
providing a root cause. |
static LiAuthorizationException |
generalEx(int code,
java.lang.String errorDescription) |
int |
hashCode() |
android.content.Intent |
toIntent()
Creates an intent from this exception.
|
org.json.JSONObject |
toJson()
Produces a JSON representation of the authorization exception, for transmission or storage.
|
java.lang.String |
toJsonString()
Provides a JSON string representation of an authorization exception, for transmission or
storage.
|
java.lang.String |
toString() |
public static final java.lang.String EXTRA_EXCEPTION
LiAuthorizationException
in an intent by
toIntent()
.public static final java.lang.String PARAM_ERROR
public static final java.lang.String PARAM_ERROR_DESCRIPTION
public static final java.lang.String PARAM_ERROR_URI
public static final int TYPE_GENERAL_ERROR
public static final int TYPE_OAUTH_AUTHORIZATION_ERROR
public static final int TYPE_OAUTH_TOKEN_ERROR
public static final int TYPE_RESOURCE_SERVER_AUTHORIZATION_ERROR
public static final int TYPE_OAUTH_REGISTRATION_ERROR
protected static final java.lang.String KEY_TYPE
protected static final java.lang.String KEY_CODE
protected static final java.lang.String KEY_ERROR
protected static final java.lang.String KEY_ERROR_DESCRIPTION
protected static final java.lang.String KEY_ERROR_URI
public final int type
public final int code
public final java.lang.String error
public final java.lang.String errorDescription
public final android.net.Uri errorUri
public LiAuthorizationException(int type, int code, java.lang.String error, java.lang.String errorDescription, android.net.Uri errorUri, java.lang.Throwable rootCause)
public static LiAuthorizationException generalEx(int code, java.lang.String errorDescription)
public static LiAuthorizationException fromTemplate(LiAuthorizationException ex, java.lang.Throwable rootCause)
LiAuthorizationException.GeneralErrors
, LiAuthorizationException.AuthorizationRequestErrors
or LiAuthorizationException.TokenRequestErrors
,
providing a root cause.public static LiAuthorizationException fromOAuthTemplate(LiAuthorizationException ex, java.lang.String errorOverride, java.lang.String errorDescriptionOverride, android.net.Uri errorUriOverride)
LiAuthorizationException.AuthorizationRequestErrors
or LiAuthorizationException.TokenRequestErrors
, adding information
retrieved from OAuth error response.public static LiAuthorizationException fromJson(java.lang.String jsonStr) throws org.json.JSONException
LiAuthorizationException
from the JSON produced by
toJsonString()
.org.json.JSONException
- if the JSON is malformed or missing required propertiespublic static LiAuthorizationException fromJson(org.json.JSONObject json) throws org.json.JSONException
LiAuthorizationException
from the JSON produced by
toJson()
.org.json.JSONException
- if the JSON is malformed or missing required propertiespublic static LiAuthorizationException fromIntent(android.content.Intent data)
LiAuthorizationException
from an intent produced by toIntent()
.
This is used to retrieve an error response in the handler registered for a call topublic org.json.JSONObject toJson()
public java.lang.String toJsonString()
public android.content.Intent toIntent()
public boolean equals(java.lang.Object obj)
type
and code
are the same; all other properties are irrelevant for comparison.equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Throwable