Skip to content

Commit 5b5e8de

Browse files
committed
get_authorization_request_url(...) API refactoring
1 parent 7aceb91 commit 5b5e8de

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

msal/application.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,6 @@ def get_authorization_request_url(
194194
login_hint=None, # type: Optional[str]
195195
state=None, # Recommended by OAuth2 for CSRF protection
196196
redirect_uri=None,
197-
authority=None, # By default, it will use self.authority;
198-
# Multi-tenant app can use new authority on demand
199197
response_type="code", # Can be "token" if you use Implicit Grant
200198
**kwargs):
201199
"""Constructs a URL for you to start a Authorization Code Grant.
@@ -217,10 +215,17 @@ def get_authorization_request_url(
217215
(Under the hood, we simply merge scope and additional_scope before
218216
sending them on the wire.)
219217
"""
218+
authority = kwargs.pop("authority", None) # Historically we support this
219+
if authority:
220+
warnings.warn(
221+
"We haven't decided if this method will accept authority parameter")
222+
# The previous implementation is, it will use self.authority by default.
223+
# Multi-tenant app can use new authority on demand
220224
the_authority = Authority(
221225
authority,
222226
verify=self.verify, proxies=self.proxies, timeout=self.timeout,
223227
) if authority else self.authority
228+
224229
client = Client(
225230
{"authorization_endpoint": the_authority.authorization_endpoint},
226231
self.client_id)

0 commit comments

Comments
 (0)