001    package com.nimbusds.oauth2.sdk;
002    
003    
004    /**
005     * OAuth 2.0 authorisation and token endpoint errors.
006     *
007     * @author Vladimir Dzhuvinov
008     * @version $version$ (2013-01-29)
009     */
010    public final class OAuth2Error {
011    
012    
013            // Base OAuth 2.0 authorisation errors
014            
015            /**
016             * The request is missing a required parameter, includes an invalid 
017             * parameter code, or is otherwise malformed.
018             */
019            public static final ErrorObject INVALID_REQUEST = 
020                    new ErrorObject("invalid_request", "Invalid request");
021            
022            
023            /**
024             * The client is not authorised to request an authorisation code using 
025             * this method.
026             */
027            public static final ErrorObject UNAUTHORIZED_CLIENT =
028                    new ErrorObject("unauthorized_client", "Unauthorized client");
029            
030            
031            /**
032             * The resource owner or authorisation server denied the request.
033             */
034            public static final ErrorObject ACCESS_DENIED =
035                    new ErrorObject("access_denied", "Access denied by resource owner or authorization server");
036            
037            
038            /**
039             * The authorisation server does not support obtaining an authorisation 
040             * code using this method.
041             */
042            public static final ErrorObject UNSUPPORTED_RESPONSE_TYPE =
043                    new ErrorObject("unsupported_response_type", "Unsupported response type");
044            
045            
046            /**
047             * The requested scope is invalid, unknown, or malformed.
048             */
049            public static final ErrorObject INVALID_SCOPE =
050                    new ErrorObject("invalid_scope", "Invalid, unknown or malformed scope");
051            
052            
053            /**
054             * The authorisation server encountered an unexpected condition which 
055             * prevented it from fulfilling the request.
056             */
057            public static final ErrorObject SERVER_ERROR =
058                    new ErrorObject("server_error", "Unexpected server error");
059            
060            
061            /**
062             * The authorisation server is currently unable to handle the request 
063             * due to a temporary overloading or maintenance of the server.
064             */
065            public static final ErrorObject TEMPORARILY_UNAVAILABLE =
066                    new ErrorObject("temporarily_unavailable", "The authorization server is temporarily unavailable");
067            
068            
069            // Token, Base OAuth 2.0 authorisation errors, section 5.2
070            
071            /**
072             * Client authentication failed (e.g. unknown client, no client 
073             * authentication included, or unsupported authentication method).
074             */
075            public static final ErrorObject INVALID_CLIENT =
076                    new ErrorObject("invalid_client", "Client authentication failed");
077            
078            
079            /**
080             * The provided authorisation grant (e.g. authorisation code, resource 
081             * owner credentials) or refresh token is invalid, expired, revoked, 
082             * does not match the redirection URI used in the authorization request,
083             * or was issued to another client.
084             */
085            public static final ErrorObject INVALID_GRANT =
086                    new ErrorObject("invalid_grant", "Invalid grant");
087            
088            
089            /**
090             * The authorisation grant type is not supported by the authorisation 
091             * server.
092             */
093            public static final ErrorObject UNSUPPORTED_GRANT_TYPE =
094                    new ErrorObject("unsupported_grant_type", "Unsupported grant type");
095    
096            
097            /**
098             * Prevents public instantiation.
099             */
100            private OAuth2Error() { }
101    }