Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
get_authorization_request_url(...) API refactoring
  • Loading branch information
rayluo committed Oct 10, 2019
commit 5b5e8de57996ab0ebbec1b0b10d361d781187e84
9 changes: 7 additions & 2 deletions msal/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,6 @@ def get_authorization_request_url(
login_hint=None, # type: Optional[str]
state=None, # Recommended by OAuth2 for CSRF protection
redirect_uri=None,
authority=None, # By default, it will use self.authority;
# Multi-tenant app can use new authority on demand
response_type="code", # Can be "token" if you use Implicit Grant
**kwargs):
"""Constructs a URL for you to start a Authorization Code Grant.
Expand All @@ -217,10 +215,17 @@ def get_authorization_request_url(
(Under the hood, we simply merge scope and additional_scope before
sending them on the wire.)
"""
authority = kwargs.pop("authority", None) # Historically we support this
if authority:
warnings.warn(
"We haven't decided if this method will accept authority parameter")
# The previous implementation is, it will use self.authority by default.
# Multi-tenant app can use new authority on demand
the_authority = Authority(
authority,
verify=self.verify, proxies=self.proxies, timeout=self.timeout,
) if authority else self.authority

client = Client(
{"authorization_endpoint": the_authority.authorization_endpoint},
self.client_id)
Expand Down