diff options
author | Jonathan Huot <JonathanHuot@users.noreply.github.com> | 2018-12-16 18:58:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-16 18:58:18 +0100 |
commit | 2ae71acab9c78598aef10ba584a7284ffa07b48f (patch) | |
tree | 2a2ebf514137c92e124d4c3718de09338d13d848 /oauthlib/oauth2/rfc6749/errors.py | |
parent | 6f3aa6c3a89ac9a61831bd67f061725f5b5661fb (diff) | |
parent | 8de1e52fabdd9c3738a012bb88e2234d1bd06255 (diff) | |
download | oauthlib-bandit.tar.gz |
Merge branch 'master' into banditbandit
Diffstat (limited to 'oauthlib/oauth2/rfc6749/errors.py')
-rw-r--r-- | oauthlib/oauth2/rfc6749/errors.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/oauthlib/oauth2/rfc6749/errors.py b/oauthlib/oauth2/rfc6749/errors.py index ec2b0d1..d2a1402 100644 --- a/oauthlib/oauth2/rfc6749/errors.py +++ b/oauthlib/oauth2/rfc6749/errors.py @@ -201,6 +201,26 @@ class MissingResponseTypeError(InvalidRequestError): description = 'Missing response_type parameter.' +class MissingCodeChallengeError(InvalidRequestError): + """ + If the server requires Proof Key for Code Exchange (PKCE) by OAuth + public clients and the client does not send the "code_challenge" in + the request, the authorization endpoint MUST return the authorization + error response with the "error" value set to "invalid_request". The + "error_description" or the response of "error_uri" SHOULD explain the + nature of error, e.g., code challenge required. + """ + description = 'Code challenge required.' + + +class MissingCodeVerifierError(InvalidRequestError): + """ + The request to the token endpoint, when PKCE is enabled, has + the parameter `code_verifier` REQUIRED. + """ + description = 'Code verifier required.' + + class AccessDeniedError(OAuth2Error): """ The resource owner or authorization server denied the request. @@ -216,6 +236,18 @@ class UnsupportedResponseTypeError(OAuth2Error): error = 'unsupported_response_type' +class UnsupportedCodeChallengeMethodError(InvalidRequestError): + """ + If the server supporting PKCE does not support the requested + transformation, the authorization endpoint MUST return the + authorization error response with "error" value set to + "invalid_request". The "error_description" or the response of + "error_uri" SHOULD explain the nature of error, e.g., transform + algorithm not supported. + """ + description = 'Transform algorithm not supported.' + + class InvalidScopeError(OAuth2Error): """ The requested scope is invalid, unknown, or malformed, or |