public final class AuthorizationException extends Exception
response
to
token requests
,
response
to
configuration retrieval
.
Modifier and Type | Class and Description |
---|---|
static class |
AuthorizationException.AuthorizationRequestErrors
Error codes related to failed authorization requests.
|
static class |
AuthorizationException.GeneralErrors
Error codes specific to AppAuth for Android, rather than those defined in the OAuth2 and
OpenID specifications.
|
static class |
AuthorizationException.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.
|
String |
error
The error string as it is found in the OAuth2 protocol.
|
String |
errorDescription
The human readable error message associated with this exception, if available.
|
Uri |
errorUri
A URI identifying a human-readable web page with information about this error.
|
static String |
EXTRA_EXCEPTION
The extra string that used to store an
AuthorizationException in an intent by
toIntent() . |
static String |
PARAM_ERROR
The OAuth2 parameter used to indicate the type of error during an authorization or
token request.
|
static String |
PARAM_ERROR_DESCRIPTION
The OAuth2 parameter used to provide a human readable description of the error which
occurred.
|
static 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_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 |
---|
AuthorizationException(int type,
int code,
String error,
String errorDescription,
Uri errorUri,
Throwable rootCause)
Instantiates an authorization request with optional root cause information.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
|
static AuthorizationException |
fromIntent(Intent data)
Extracts an
AuthorizationException from an intent produced by toIntent() . |
static AuthorizationException |
fromJson(JSONObject json)
Reconstructs an
AuthorizationException from the JSON produced by
toJson() . |
static AuthorizationException |
fromJson(String jsonStr)
Reconstructs an
AuthorizationException from the JSON produced by
toJsonString() . |
int |
hashCode() |
Intent |
toIntent()
Creates an intent from this exception.
|
JSONObject |
toJson()
Produces a JSON representation of the authorization exception, for transmission or storage.
|
String |
toJsonString()
Provides a JSON string representation of an authorization exception, for transmission or
storage.
|
String |
toString() |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
public static final String EXTRA_EXCEPTION
AuthorizationException
in an intent by
toIntent()
.public static final String PARAM_ERROR
public static final String PARAM_ERROR_DESCRIPTION
public static final 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 final int type
public final int code
@Nullable public final String errorDescription
public static AuthorizationException fromJson(@NonNull String jsonStr) throws JSONException
AuthorizationException
from the JSON produced by
toJsonString()
.JSONException
- if the JSON is malformed or missing required propertiespublic static AuthorizationException fromJson(@NonNull JSONObject json) throws JSONException
AuthorizationException
from the JSON produced by
toJson()
.JSONException
- if the JSON is malformed or missing required properties@Nullable public static AuthorizationException fromIntent(Intent data)
AuthorizationException
from an intent produced by toIntent()
.
This is used to retrieve an error response in the handler registered for a call to
AuthorizationService.performAuthorizationRequest(net.openid.appauth.AuthorizationRequest, android.app.PendingIntent)
.@NonNull public JSONObject toJson()
@NonNull public String toJsonString()
@NonNull public Intent toIntent()
AuthorizationService.performAuthorizationRequest(net.openid.appauth.AuthorizationRequest, android.app.PendingIntent)
.public boolean equals(Object obj)