Skip to content

Commit 583adeb

Browse files
committed
Wire up verify and proxies for mex and wstrust
1 parent 2d6c373 commit 583adeb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

msal/application.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,17 +387,20 @@ def acquire_token_by_username_password(
387387

388388
def _acquire_token_by_username_password_federated(
389389
self, user_realm_result, username, password, scopes=None, **kwargs):
390+
verify = kwargs.pop("verify", self.verify)
391+
proxies = kwargs.pop("proxies", self.proxies)
390392
wstrust_endpoint = {}
391393
if user_realm_result.get("federation_metadata_url"):
392394
wstrust_endpoint = mex_send_request(
393-
user_realm_result["federation_metadata_url"])
395+
user_realm_result["federation_metadata_url"],
396+
verify=self.verify, proxies=self.proxies)
394397
logger.debug("wstrust_endpoint = %s", wstrust_endpoint)
395398
wstrust_result = wst_send_request(
396399
username, password, user_realm_result.get("cloud_audience_urn"),
397400
wstrust_endpoint.get("address",
398401
# Fallback to an AAD supplied endpoint
399402
user_realm_result.get("federation_active_auth_url")),
400-
wstrust_endpoint.get("action"), **kwargs)
403+
wstrust_endpoint.get("action"), verify=verify, proxies=proxies)
401404
if not ("token" in wstrust_result and "type" in wstrust_result):
402405
raise RuntimeError("Unsuccessful RSTR. %s" % wstrust_result)
403406
grant_type = {

0 commit comments

Comments
 (0)