Skip to content

Commit 17307d8

Browse files
committed
Using relative import for Python 3
1 parent 5528fe3 commit 17307d8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

msal/application.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
from oauth2cli import Client
1111
from .authority import Authority
1212
from oauth2cli.assertion import JwtSigner
13-
import mex
14-
import wstrust_request
13+
from .mex import send_request as mex_send_request
14+
from .wstrust_request import send_request as wst_send_request
1515
from .wstrust_response import SAML_TOKEN_TYPE_V1, SAML_TOKEN_TYPE_V2
1616
from .token_cache import TokenCache
1717

@@ -299,10 +299,10 @@ def _acquire_token_by_username_password_federated(
299299
self, user_realm_result, username, password, scopes=None, **kwargs):
300300
wstrust_endpoint = {}
301301
if user_realm_result.get("federation_metadata_url"):
302-
wstrust_endpoint = mex.send_request(
302+
wstrust_endpoint = mex_send_request(
303303
user_realm_result["federation_metadata_url"])
304304
logger.debug("wstrust_endpoint = %s", wstrust_endpoint)
305-
wstrust_result = wstrust_request.send_request(
305+
wstrust_result = wst_send_request(
306306
username, password, user_realm_result.get("cloud_audience_urn"),
307307
wstrust_endpoint.get("address",
308308
# Fallback to an AAD supplied endpoint

msal/wstrust_request.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
import requests
3434

3535
from .mex import Mex
36-
import wstrust_response
36+
from .wstrust_response import parse_response
3737

3838

3939
logger = logging.getLogger(__file__)
@@ -61,7 +61,7 @@ def send_request(
6161
logger.debug("Unsuccessful WsTrust request receives: %s", resp.text)
6262
# It turns out ADFS uses 5xx status code even with client-side incorrect password error
6363
# resp.raise_for_status()
64-
return wstrust_response.parse_response(resp.text)
64+
return parse_response(resp.text)
6565

6666
def escape_password(password):
6767
return (password.replace('&', '&').replace('"', '"')

0 commit comments

Comments
 (0)