diff options
-rw-r--r-- | CHANGELOG.rst | 7 | ||||
-rw-r--r-- | oauthlib/oauth2/rfc6749/clients/mobile_application.py | 2 | ||||
-rw-r--r-- | oauthlib/oauth2/rfc6749/clients/service_application.py | 1 | ||||
-rw-r--r-- | oauthlib/oauth2/rfc6749/clients/web_application.py | 1 |
4 files changed, 10 insertions, 1 deletions
diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 9407470..c42df83 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,11 +4,17 @@ Changelog 3.1.1 (TBD) ------------------ OAuth2.0 Client - Bugfixes + * #730: Base OAuth2 Client now has a consistent way of managing the `scope`: it consistently relies on the `scope` provided in the constructor if any, except if overridden temporarily in a method call. Note that in particular providing a non-None `scope` in `prepare_authorization_request` or `prepare_refresh_token` does not override anymore `self.scope` forever, it is just used temporarily. + * #726: MobileApplicationClient.prepare_request_uri and MobileApplicationClient.parse_request_uri_response, + ServiceApplicationClient.prepare_request_body, + and WebApplicationClient.prepare_request_uri now correctly use the default `scope` provided in + constructor. + * #725: LegacyApplicationClient.prepare_request_body now correctly uses the default `scope` provided in constructor 3.1.0 (2019-08-06) ------------------ @@ -36,7 +42,6 @@ OAuth2.0 Client - Bugfixes * #290: Fix Authorization Code's errors processing * #603: BackendApplicationClient.prepare_request_body use the `scope` argument as intended. * #672: Fix edge case when `expires_in=Null` - * #725: LegacyApplicationClient.prepare_request_body now correctly uses the default `scope` provided in constructor OAuth1.0 Client diff --git a/oauthlib/oauth2/rfc6749/clients/mobile_application.py b/oauthlib/oauth2/rfc6749/clients/mobile_application.py index 73627c4..cd325f4 100644 --- a/oauthlib/oauth2/rfc6749/clients/mobile_application.py +++ b/oauthlib/oauth2/rfc6749/clients/mobile_application.py @@ -91,6 +91,7 @@ class MobileApplicationClient(Client): .. _`Section 3.3`: https://tools.ietf.org/html/rfc6749#section-3.3 .. _`Section 10.12`: https://tools.ietf.org/html/rfc6749#section-10.12 """ + scope = self.scope if scope is None else scope return prepare_grant_uri(uri, self.client_id, self.response_type, redirect_uri=redirect_uri, state=state, scope=scope, **kwargs) @@ -167,6 +168,7 @@ class MobileApplicationClient(Client): .. _`Section 7.1`: https://tools.ietf.org/html/rfc6749#section-7.1 .. _`Section 3.3`: https://tools.ietf.org/html/rfc6749#section-3.3 """ + scope = self.scope if scope is None else scope self.token = parse_implicit_response(uri, state=state, scope=scope) self.populate_token_attributes(self.token) return self.token diff --git a/oauthlib/oauth2/rfc6749/clients/service_application.py b/oauthlib/oauth2/rfc6749/clients/service_application.py index 09fc7ba..34c2a66 100644 --- a/oauthlib/oauth2/rfc6749/clients/service_application.py +++ b/oauthlib/oauth2/rfc6749/clients/service_application.py @@ -181,6 +181,7 @@ class ServiceApplicationClient(Client): kwargs['client_id'] = self.client_id kwargs['include_client_id'] = include_client_id + scope = self.scope if scope is None else scope return prepare_token_request(self.grant_type, body=body, assertion=assertion, diff --git a/oauthlib/oauth2/rfc6749/clients/web_application.py b/oauthlib/oauth2/rfc6749/clients/web_application.py index aedc9d1..42b2c96 100644 --- a/oauthlib/oauth2/rfc6749/clients/web_application.py +++ b/oauthlib/oauth2/rfc6749/clients/web_application.py @@ -84,6 +84,7 @@ class WebApplicationClient(Client): .. _`Section 3.3`: https://tools.ietf.org/html/rfc6749#section-3.3 .. _`Section 10.12`: https://tools.ietf.org/html/rfc6749#section-10.12 """ + scope = self.scope if scope is None else scope return prepare_grant_uri(uri, self.client_id, 'code', redirect_uri=redirect_uri, scope=scope, state=state, **kwargs) |