summaryrefslogtreecommitdiff
path: root/oauthlib/oauth2/rfc6749/errors.py
diff options
context:
space:
mode:
authorJonathan Huot <jonathan.huot@thomsonreuters.com>2018-08-02 10:29:22 +0200
committerJonathan Huot <jonathan.huot@thomsonreuters.com>2018-08-02 10:29:22 +0200
commit1d07167210297cd9691e5397f09477fea5df5279 (patch)
treef7e9b97dc966161b11c21945b58922f50441f187 /oauthlib/oauth2/rfc6749/errors.py
parentc9ead44e9c3bef100a6434ffbe56a002d54f0475 (diff)
parentfbacd77b602e4c60f8da2413c150fa7f20b2f83c (diff)
downloadoauthlib-431-customerrors.tar.gz
Merge branch 'master' into 431-customerrors431-customerrors
Diffstat (limited to 'oauthlib/oauth2/rfc6749/errors.py')
-rw-r--r--oauthlib/oauth2/rfc6749/errors.py126
1 files changed, 25 insertions, 101 deletions
diff --git a/oauthlib/oauth2/rfc6749/errors.py b/oauthlib/oauth2/rfc6749/errors.py
index 43aa38e..a15d6c5 100644
--- a/oauthlib/oauth2/rfc6749/errors.py
+++ b/oauthlib/oauth2/rfc6749/errors.py
@@ -267,113 +267,13 @@ class UnsupportedGrantTypeError(OAuth2Error):
class UnsupportedTokenTypeError(OAuth2Error):
"""
- The authorization server does not support the revocation of the
+ The authorization server does not support the hint of the
presented token type. I.e. the client tried to revoke an access token
on a server not supporting this feature.
"""
error = 'unsupported_token_type'
-class FatalOpenIDClientError(FatalClientError):
- pass
-
-
-class OpenIDClientError(OAuth2Error):
- pass
-
-
-class InteractionRequired(OpenIDClientError):
- """
- The Authorization Server requires End-User interaction to proceed.
-
- This error MAY be returned when the prompt parameter value in the
- Authentication Request is none, but the Authentication Request cannot be
- completed without displaying a user interface for End-User interaction.
- """
- error = 'interaction_required'
- status_code = 401
-
-
-class LoginRequired(OpenIDClientError):
- """
- The Authorization Server requires End-User authentication.
-
- This error MAY be returned when the prompt parameter value in the
- Authentication Request is none, but the Authentication Request cannot be
- completed without displaying a user interface for End-User authentication.
- """
- error = 'login_required'
- status_code = 401
-
-
-class AccountSelectionRequired(OpenIDClientError):
- """
- The End-User is REQUIRED to select a session at the Authorization Server.
-
- The End-User MAY be authenticated at the Authorization Server with
- different associated accounts, but the End-User did not select a session.
- This error MAY be returned when the prompt parameter value in the
- Authentication Request is none, but the Authentication Request cannot be
- completed without displaying a user interface to prompt for a session to
- use.
- """
- error = 'account_selection_required'
-
-
-class ConsentRequired(OpenIDClientError):
- """
- The Authorization Server requires End-User consent.
-
- This error MAY be returned when the prompt parameter value in the
- Authentication Request is none, but the Authentication Request cannot be
- completed without displaying a user interface for End-User consent.
- """
- error = 'consent_required'
- status_code = 401
-
-
-class InvalidRequestURI(OpenIDClientError):
- """
- The request_uri in the Authorization Request returns an error or
- contains invalid data.
- """
- error = 'invalid_request_uri'
- description = 'The request_uri in the Authorization Request returns an ' \
- 'error or contains invalid data.'
-
-
-class InvalidRequestObject(OpenIDClientError):
- """
- The request parameter contains an invalid Request Object.
- """
- error = 'invalid_request_object'
- description = 'The request parameter contains an invalid Request Object.'
-
-
-class RequestNotSupported(OpenIDClientError):
- """
- The OP does not support use of the request parameter.
- """
- error = 'request_not_supported'
- description = 'The request parameter is not supported.'
-
-
-class RequestURINotSupported(OpenIDClientError):
- """
- The OP does not support use of the request_uri parameter.
- """
- error = 'request_uri_not_supported'
- description = 'The request_uri parameter is not supported.'
-
-
-class RegistrationNotSupported(OpenIDClientError):
- """
- The OP does not support use of the registration parameter.
- """
- error = 'registration_not_supported'
- description = 'The registration parameter is not supported.'
-
-
class InvalidTokenError(OAuth2Error):
"""
The access token provided is expired, revoked, malformed, or
@@ -402,6 +302,30 @@ class InsufficientScopeError(OAuth2Error):
"the access token.")
+class ConsentRequired(OAuth2Error):
+ """
+ The Authorization Server requires End-User consent.
+
+ This error MAY be returned when the prompt parameter value in the
+ Authentication Request is none, but the Authentication Request cannot be
+ completed without displaying a user interface for End-User consent.
+ """
+ error = 'consent_required'
+ status_code = 401
+
+
+class LoginRequired(OAuth2Error):
+ """
+ The Authorization Server requires End-User authentication.
+
+ This error MAY be returned when the prompt parameter value in the
+ Authentication Request is none, but the Authentication Request cannot be
+ completed without displaying a user interface for End-User authentication.
+ """
+ error = 'login_required'
+ status_code = 401
+
+
class CustomOAuth2Error(OAuth2Error):
"""
This error is a placeholder for all custom errors not described by the RFC.