diff options
author | Theron Luhn <theron@luhn.com> | 2018-09-02 10:13:08 -0700 |
---|---|---|
committer | Theron Luhn <theron@luhn.com> | 2018-09-02 10:13:08 -0700 |
commit | 997e8d061ae883a6460aeda71ab12b2b5bd4feed (patch) | |
tree | 3fdee515c2dd8745f5356859c473d7cfb709d866 /oauthlib/oauth2/rfc6749/grant_types/authorization_code.py | |
parent | f3d3eb9efd81459be48b052e172ffa5f76a7a445 (diff) | |
download | oauthlib-997e8d061ae883a6460aeda71ab12b2b5bd4feed.tar.gz |
Make scope optional for authorization code grant.
Diffstat (limited to 'oauthlib/oauth2/rfc6749/grant_types/authorization_code.py')
-rw-r--r-- | oauthlib/oauth2/rfc6749/grant_types/authorization_code.py | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/oauthlib/oauth2/rfc6749/grant_types/authorization_code.py b/oauthlib/oauth2/rfc6749/grant_types/authorization_code.py index 43d2efa..ab4c184 100644 --- a/oauthlib/oauth2/rfc6749/grant_types/authorization_code.py +++ b/oauthlib/oauth2/rfc6749/grant_types/authorization_code.py @@ -140,7 +140,6 @@ class AuthorizationCodeGrant(GrantTypeBase): oauthlib.oauth2.BearerToken. :returns: headers, body, status :raises: FatalClientError on invalid redirect URI or client id. - ValueError if scopes are not set on the request object. A few examples:: @@ -151,12 +150,6 @@ class AuthorizationCodeGrant(GrantTypeBase): >>> from oauthlib.oauth2 import AuthorizationCodeGrant, BearerToken >>> token = BearerToken(your_validator) >>> grant = AuthorizationCodeGrant(your_validator) - >>> grant.create_authorization_response(request, token) - Traceback (most recent call last): - File "<stdin>", line 1, in <module> - File "oauthlib/oauth2/rfc6749/grant_types.py", line 513, in create_authorization_response - raise ValueError('Scopes must be set on post auth.') - ValueError: Scopes must be set on post auth. >>> request.scopes = ['authorized', 'in', 'some', 'form'] >>> grant.create_authorization_response(request, token) (u'http://client.com/?error=invalid_request&error_description=Missing+response_type+parameter.', None, None, 400) @@ -182,11 +175,6 @@ class AuthorizationCodeGrant(GrantTypeBase): .. _`Section 10.12`: https://tools.ietf.org/html/rfc6749#section-10.12 """ try: - # request.scopes is only mandated in post auth and both pre and - # post auth use validate_authorization_request - if not request.scopes: - raise ValueError('Scopes must be set on post auth.') - self.validate_authorization_request(request) log.debug('Pre resource owner authorization validation ok for %r.', request) |