import { HttpError } from '@curveball/http-errors'; interface OAuth2Error extends HttpError { errorCode: string; } export declare function isOAuth2Error(err: Error): err is OAuth2Error; /** * The request is missing a required parameter, includes an invalid parameter * value, includes a parameter more than once or is otherwise malformed. */ export declare class InvalidRequest extends Error implements OAuth2Error { httpStatus: number; errorCode: string; } /** * The client is not authorized to request an authorization code using this * method */ export declare class UnauthorizedClient extends Error implements OAuth2Error { httpStatus: number; errorCode: string; } /** * The resource owner or authorization server denied the request */ export declare class AccessDenied extends Error implements OAuth2Error { httpStatus: number; errorCode: string; } /** * The authorization server does not support obtaining an authorization code * using this method */ export declare class UnsupportedResponseType extends Error implements OAuth2Error { httpStatus: number; errorCode: string; } /** * The requested scope is invalid, unknown or malformed */ export declare class InvalidScope extends Error implements OAuth2Error { httpStatus: number; errorCode: string; } /** * Client authentication failed (e.g., unknown client, no client authentication * included, or unsupported authentication method). The authorization server * MAY return an HTTP 401 (Unauthorized) status code to indicate which HTTP * authentication schemes are supported. If the client attempted to * authenticate via the "Authorization" request header field, the authorization * server MUST respond with an HTTP 401 (Unauthorized) status code and include * the "WWW-Authenticate" response header field matching the authentication * scheme used by the client. */ export declare class InvalidClient extends Error implements OAuth2Error { httpStatus: number; errorCode: string; } /** * 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. */ export declare class InvalidGrant extends Error implements OAuth2Error { httpStatus: number; errorCode: string; } /** * The authorization grant type is not supported by the authorization server. */ export declare class UnsupportedGrantType extends Error implements OAuth2Error { httpStatus: number; errorCode: string; } /** * The authorization server encountered an unexpected condition that prevented * it from fulfilling the request. (This error code is needed because a 500 * Internal Server Error HTTP status code cannot be returned to the client via * an HTTP redirect.) */ export declare class ServerError extends Error implements OAuth2Error { httpStatus: number; errorCode: string; } /** * The authorization server is currently unable to handle the request due to a * temporary overloading or maintenance of the server. (This error code is * needed because a 503 Service Unavailable HTTP status code cannot be returned * to the client via an HTTP redirect.) */ export declare class TemporarilyUnavailable extends Error implements OAuth2Error { httpStatus: number; errorCode: string; } export {};