Skip to content

exceptions

oauthlib.oauth2.rfc6749.errors ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error used both by OAuth 2 clients and providers to represent the spec defined error responses for all four core grant types.

AccountSelectionRequired

Bases: 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.

Source code in server/vendor/oauthlib/openid/connect/core/exceptions.py
43
44
45
46
47
48
49
50
51
52
53
54
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'

ConsentRequired

Bases: 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.

Source code in server/vendor/oauthlib/openid/connect/core/exceptions.py
57
58
59
60
61
62
63
64
65
66
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

InsufficientScopeError

Bases: OAuth2Error

The request requires higher privileges than provided by the access token. The resource server SHOULD respond with the HTTP 403 (Forbidden) status code and MAY include the "scope" attribute with the scope necessary to access the protected resource.

Source code in server/vendor/oauthlib/openid/connect/core/exceptions.py
125
126
127
128
129
130
131
132
133
134
135
136
class InsufficientScopeError(OAuth2Error):
    """
    The request requires higher privileges than provided by the
    access token.  The resource server SHOULD respond with the HTTP
    403 (Forbidden) status code and MAY include the "scope"
    attribute with the scope necessary to access the protected
    resource.
    """
    error = 'insufficient_scope'
    status_code = 403
    description = ("The request requires higher privileges than provided by "
                   "the access token.")

InteractionRequired

Bases: 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.

Source code in server/vendor/oauthlib/openid/connect/core/exceptions.py
19
20
21
22
23
24
25
26
27
28
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

InvalidRequestObject

Bases: OpenIDClientError

The request parameter contains an invalid Request Object.

Source code in server/vendor/oauthlib/openid/connect/core/exceptions.py
79
80
81
82
83
84
class InvalidRequestObject(OpenIDClientError):
    """
    The request parameter contains an invalid Request Object.
    """
    error = 'invalid_request_object'
    description = 'The request parameter contains an invalid Request Object.'

InvalidRequestURI

Bases: OpenIDClientError

The request_uri in the Authorization Request returns an error or contains invalid data.

Source code in server/vendor/oauthlib/openid/connect/core/exceptions.py
69
70
71
72
73
74
75
76
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.'

InvalidTokenError

Bases: OAuth2Error

The access token provided is expired, revoked, malformed, or invalid for other reasons. The resource SHOULD respond with the HTTP 401 (Unauthorized) status code. The client MAY request a new access token and retry the protected resource request.

Source code in server/vendor/oauthlib/openid/connect/core/exceptions.py
111
112
113
114
115
116
117
118
119
120
121
122
class InvalidTokenError(OAuth2Error):
    """
    The access token provided is expired, revoked, malformed, or
    invalid for other reasons.  The resource SHOULD respond with
    the HTTP 401 (Unauthorized) status code.  The client MAY
    request a new access token and retry the protected resource
    request.
    """
    error = 'invalid_token'
    status_code = 401
    description = ("The access token provided is expired, revoked, malformed, "
                   "or invalid for other reasons.")

LoginRequired

Bases: 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.

Source code in server/vendor/oauthlib/openid/connect/core/exceptions.py
31
32
33
34
35
36
37
38
39
40
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

RegistrationNotSupported

Bases: OpenIDClientError

The OP does not support use of the registration parameter.

Source code in server/vendor/oauthlib/openid/connect/core/exceptions.py
103
104
105
106
107
108
class RegistrationNotSupported(OpenIDClientError):
    """
    The OP does not support use of the registration parameter.
    """
    error = 'registration_not_supported'
    description = 'The registration parameter is not supported.'

RequestNotSupported

Bases: OpenIDClientError

The OP does not support use of the request parameter.

Source code in server/vendor/oauthlib/openid/connect/core/exceptions.py
87
88
89
90
91
92
class RequestNotSupported(OpenIDClientError):
    """
    The OP does not support use of the request parameter.
    """
    error = 'request_not_supported'
    description = 'The request parameter is not supported.'

RequestURINotSupported

Bases: OpenIDClientError

The OP does not support use of the request_uri parameter.

Source code in server/vendor/oauthlib/openid/connect/core/exceptions.py
 95
 96
 97
 98
 99
100
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.'