Skip to content

Commit

Permalink
Merge branch 'wire-up-some-kwargs' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
rayluo committed Sep 23, 2019
2 parents 9e122ee + 35b6649 commit e4510a3
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions msal/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def acquire_token_by_authorization_code(
# REQUIRED, if the "redirect_uri" parameter was included in the
# authorization request as described in Section 4.1.1, and their
# values MUST be identical.
):
**kwargs):
"""The second half of the Authorization Code Grant.
:param code: The authorization code returned from Authorization Server.
Expand Down Expand Up @@ -270,9 +270,11 @@ def acquire_token_by_authorization_code(
# really empty.
assert isinstance(scopes, list), "Invalid parameter type"
return self.client.obtain_token_by_authorization_code(
code, redirect_uri=redirect_uri,
data={"scope": decorate_scope(scopes, self.client_id)},
)
code, redirect_uri=redirect_uri,
data=dict(
kwargs.pop("data", {}),
scope=decorate_scope(scopes, self.client_id)),
**kwargs)

def get_accounts(self, username=None):
"""Get a list of accounts which previously signed in, i.e. exists in cache.
Expand Down Expand Up @@ -551,7 +553,8 @@ def acquire_token_by_device_flow(self, flow, **kwargs):
"""
return self.client.obtain_token_by_device_flow(
flow,
data={"code": flow["device_code"]}, # 2018-10-4 Hack:
data=dict(kwargs.pop("data", {}), code=flow["device_code"]),
# 2018-10-4 Hack:
# during transition period,
# service seemingly need both device_code and code parameter.
**kwargs)
Expand Down

0 comments on commit e4510a3

Please sign in to comment.