summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Huot <JonathanHuot@users.noreply.github.com>2020-04-22 14:19:48 +0200
committerGitHub <noreply@github.com>2020-04-22 14:19:48 +0200
commit90d6398c6d5f98f65d98defda71987fbf457dd00 (patch)
treeb56ffa30f30b54d0a1c7d07dad99f426303177ad
parente25544737a7460b075c091d4b300854b1e99e481 (diff)
parent3c1fea9ce21a2005d08328aba96be620a91fde6c (diff)
downloadoauthlib-90d6398c6d5f98f65d98defda71987fbf457dd00.tar.gz
Merge pull request #729 from smarie/fix_issue_728
-rw-r--r--CHANGELOG.rst7
-rw-r--r--oauthlib/oauth2/rfc6749/clients/mobile_application.py2
-rw-r--r--oauthlib/oauth2/rfc6749/clients/service_application.py1
-rw-r--r--oauthlib/oauth2/rfc6749/clients/web_application.py1
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)