com.unboundid.directory.sdk.broker.types
Class OAuthException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.unboundid.directory.sdk.broker.types.OAuthException
All Implemented Interfaces:
java.io.Serializable

@Extensible
public class OAuthException
extends java.lang.Exception

This class provides a type of Exception which is used to indicate an error when interfacing with an OAuth 2 extension.

See Also:
Serialized Form

Field Summary
static java.lang.String ACCESS_DENIED
          The access_denied OAuth 2 error code.
static java.lang.String CONSENT_REQUIRED
          The consent_required OAuth 2 error code.
static java.lang.String INVALID_CLIENT
          The invalid_client OAuth 2 error code.
static java.lang.String INVALID_GRANT
          The invalid_grant OAuth 2 error code.
static java.lang.String INVALID_REQUEST
          The invalid_request OAuth 2 error code.
static java.lang.String INVALID_SCOPE
          The invalid_scope OAuth 2 error code.
static java.lang.String INVALID_TOKEN
          The invalid_token OAuth 2 error code.
static java.lang.String LOGIN_REQUIRED
          The login_required OAuth 2 error code.
static java.lang.String SERVER_ERROR
          The server_error OAuth 2 error code.
static java.lang.String TEMPORARILY_UNAVAILABLE
          The temporarily_unavailable OAuth 2 error code.
static java.lang.String UNAUTHORIZED_CLIENT
          The unauthorized_client OAuth 2 error code.
static java.lang.String UNSUPPORTED_GRANT_TYPE
          The unsupported_grant_type OAuth 2 error code.
static java.lang.String UNSUPPORTED_RESPONSE_TYPE
          The unsupported_response_type OAuth 2 error code.
 
Constructor Summary
OAuthException(java.lang.String oauth2ErrorCode)
          Creates a new OAuthException with the provided information.
OAuthException(java.lang.String oauth2ErrorCode, java.lang.String message)
          Creates a new OAuthException with the provided information.
OAuthException(java.lang.String oauth2ErrorCode, java.lang.String message, java.lang.String errorUri, java.lang.Throwable cause)
          Creates a new OAuthException with the provided information.
OAuthException(java.lang.String oauth2ErrorCode, java.lang.Throwable cause)
          Creates a new OAuthException with the provided information.
 
Method Summary
 java.lang.String getErrorUri()
          Retrieves the URI identifying a web page with information about the error or null if not available.
 java.lang.String getOauth2ErrorCode()
          Retrieves the OAuth 2 error code that should be returned to the client application.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ACCESS_DENIED

public static final java.lang.String ACCESS_DENIED
The access_denied OAuth 2 error code. Used when the resource owner or authorization server denied the request.

See Also:
Constant Field Values

CONSENT_REQUIRED

public static final java.lang.String CONSENT_REQUIRED
The consent_required OAuth 2 error code. Used when the Authorization Server requires End-User consent.

See Also:
Constant Field Values

INVALID_CLIENT

public static final java.lang.String INVALID_CLIENT
The invalid_client OAuth 2 error code. Used when client authentication failed (e.g., unknown client, no client authentication included, or unsupported authentication method).

See Also:
Constant Field Values

INVALID_GRANT

public static final java.lang.String INVALID_GRANT
The invalid_grant OAuth 2 error code. Used when the provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client.

See Also:
Constant Field Values

INVALID_REQUEST

public static final java.lang.String INVALID_REQUEST
The invalid_request OAuth 2 error code. Used when the request is missing a required parameter, includes an unsupported parameter value (other than grant type), repeats a parameter, includes multiple credentials, utilizes more than one mechanism for authenticating the client, or is otherwise malformed.

See Also:
Constant Field Values

INVALID_SCOPE

public static final java.lang.String INVALID_SCOPE
The invalid_scope OAuth 2 error code. Used when the requested scope is invalid, unknown, or malformed

See Also:
Constant Field Values

INVALID_TOKEN

public static final java.lang.String INVALID_TOKEN
The invalid_token OAuth 2 error code. Used when the provided access or refresh token value is invalid.

See Also:
Constant Field Values

LOGIN_REQUIRED

public static final java.lang.String LOGIN_REQUIRED
The login_required OAuth 2 error code. Used when the Authorization Server requires End-User authentication.

See Also:
Constant Field Values

SERVER_ERROR

public static final java.lang.String SERVER_ERROR
The server_error OAuth 2 error code. Used when the authorization server encountered an unexpected condition that prevented it from fulfilling the request.

See Also:
Constant Field Values

TEMPORARILY_UNAVAILABLE

public static final java.lang.String TEMPORARILY_UNAVAILABLE
The temporarily_unavailable OAuth 2 error code. Used when the authorization server is currently unable to handle the request due to a temporary overloading or maintenance of the server.

See Also:
Constant Field Values

UNAUTHORIZED_CLIENT

public static final java.lang.String UNAUTHORIZED_CLIENT
The unauthorized_client OAuth 2 error code. Used when the authenticated client is not authorized to use this authorization grant type.

See Also:
Constant Field Values

UNSUPPORTED_GRANT_TYPE

public static final java.lang.String UNSUPPORTED_GRANT_TYPE
The unsupported_grant_type OAuth 2 error code. Used when the authorization grant type is not supported by the authorization server.

See Also:
Constant Field Values

UNSUPPORTED_RESPONSE_TYPE

public static final java.lang.String UNSUPPORTED_RESPONSE_TYPE
The unsupported_response_type OAuth 2 error code. Used when the authorization server does not support obtaining an authorization code using this method.

See Also:
Constant Field Values
Constructor Detail

OAuthException

public OAuthException(java.lang.String oauth2ErrorCode)
Creates a new OAuthException with the provided information.

Parameters:
oauth2ErrorCode - The OAuth 2 error code that should be returned to the client application.

OAuthException

public OAuthException(java.lang.String oauth2ErrorCode,
                      java.lang.String message)
Creates a new OAuthException with the provided information.

Parameters:
oauth2ErrorCode - The OAuth 2 error code that should be returned to the client application.
message - The message that explains the problem that occurred.

OAuthException

public OAuthException(java.lang.String oauth2ErrorCode,
                      java.lang.Throwable cause)
Creates a new OAuthException with the provided information.

Parameters:
oauth2ErrorCode - The OAuth 2 error code that should be returned to the client application.
cause - The underlying cause that triggered this exception.

OAuthException

public OAuthException(java.lang.String oauth2ErrorCode,
                      java.lang.String message,
                      java.lang.String errorUri,
                      java.lang.Throwable cause)
Creates a new OAuthException with the provided information.

Parameters:
oauth2ErrorCode - The OAuth 2 error code that should be returned to the client application.
message - The message that explains the problem that occurred.
errorUri - A URI identifying a web page with information about the error.
cause - The underlying cause that triggered this exception.
Method Detail

getOauth2ErrorCode

public java.lang.String getOauth2ErrorCode()
Retrieves the OAuth 2 error code that should be returned to the client application.

Returns:
The OAuth 2 error code that should be returned to the client application.

getErrorUri

public java.lang.String getErrorUri()
Retrieves the URI identifying a web page with information about the error or null if not available.

Returns:
The URI identifying a web page with information about the error or null if not available.