Skip to content

Commit 90d6398

Browse files
authored
Merge pull request oauthlib#729 from smarie/fix_issue_728
2 parents e255447 + 3c1fea9 commit 90d6398

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

CHANGELOG.rst

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,17 @@ Changelog
44
3.1.1 (TBD)
55
------------------
66
OAuth2.0 Client - Bugfixes
7+
78
* #730: Base OAuth2 Client now has a consistent way of managing the `scope`: it consistently
89
relies on the `scope` provided in the constructor if any, except if overridden temporarily
910
in a method call. Note that in particular providing a non-None `scope` in
1011
`prepare_authorization_request` or `prepare_refresh_token` does not override anymore
1112
`self.scope` forever, it is just used temporarily.
13+
* #726: MobileApplicationClient.prepare_request_uri and MobileApplicationClient.parse_request_uri_response,
14+
ServiceApplicationClient.prepare_request_body,
15+
and WebApplicationClient.prepare_request_uri now correctly use the default `scope` provided in
16+
constructor.
17+
* #725: LegacyApplicationClient.prepare_request_body now correctly uses the default `scope` provided in constructor
1218

1319
3.1.0 (2019-08-06)
1420
------------------
@@ -36,7 +42,6 @@ OAuth2.0 Client - Bugfixes
3642
* #290: Fix Authorization Code's errors processing
3743
* #603: BackendApplicationClient.prepare_request_body use the `scope` argument as intended.
3844
* #672: Fix edge case when `expires_in=Null`
39-
* #725: LegacyApplicationClient.prepare_request_body now correctly uses the default `scope` provided in constructor
4045

4146
OAuth1.0 Client
4247

oauthlib/oauth2/rfc6749/clients/mobile_application.py

+2
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ def prepare_request_uri(self, uri, redirect_uri=None, scope=None,
9191
.. _`Section 3.3`: https://tools.ietf.org/html/rfc6749#section-3.3
9292
.. _`Section 10.12`: https://tools.ietf.org/html/rfc6749#section-10.12
9393
"""
94+
scope = self.scope if scope is None else scope
9495
return prepare_grant_uri(uri, self.client_id, self.response_type,
9596
redirect_uri=redirect_uri, state=state, scope=scope, **kwargs)
9697

@@ -167,6 +168,7 @@ def parse_request_uri_response(self, uri, state=None, scope=None):
167168
.. _`Section 7.1`: https://tools.ietf.org/html/rfc6749#section-7.1
168169
.. _`Section 3.3`: https://tools.ietf.org/html/rfc6749#section-3.3
169170
"""
171+
scope = self.scope if scope is None else scope
170172
self.token = parse_implicit_response(uri, state=state, scope=scope)
171173
self.populate_token_attributes(self.token)
172174
return self.token

oauthlib/oauth2/rfc6749/clients/service_application.py

+1
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ def prepare_request_body(self,
181181

182182
kwargs['client_id'] = self.client_id
183183
kwargs['include_client_id'] = include_client_id
184+
scope = self.scope if scope is None else scope
184185
return prepare_token_request(self.grant_type,
185186
body=body,
186187
assertion=assertion,

oauthlib/oauth2/rfc6749/clients/web_application.py

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ def prepare_request_uri(self, uri, redirect_uri=None, scope=None,
8484
.. _`Section 3.3`: https://tools.ietf.org/html/rfc6749#section-3.3
8585
.. _`Section 10.12`: https://tools.ietf.org/html/rfc6749#section-10.12
8686
"""
87+
scope = self.scope if scope is None else scope
8788
return prepare_grant_uri(uri, self.client_id, 'code',
8889
redirect_uri=redirect_uri, scope=scope, state=state, **kwargs)
8990

0 commit comments

Comments
 (0)