Skip to content

Commit f34f1e4

Browse files
committed
Fix a small issue and update broker test
1 parent 67169aa commit f34f1e4

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

msal/broker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import logging
66
import time
77
import uuid
8-
8+
import sys
99

1010
logger = logging.getLogger(__name__)
1111
try:

tests/broker-test.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import msal
99
import getpass
1010
import os
11+
import sys
1112
try:
1213
from dotenv import load_dotenv # Use this only in local dev machine
1314
load_dotenv() # take environment variables from .env.
@@ -25,10 +26,19 @@
2526
_SSH_CERT_DATA = {"token_type": "ssh-cert", "key_id": "key1", "req_cnf": _JWK1}
2627
_SSH_CERT_SCOPE = "https://pas.windows.net/CheckMyAccess/Linux/.default"
2728

28-
pca = msal.PublicClientApplication(
29-
_AZURE_CLI,
30-
authority="https://login.microsoftonline.com/organizations",
31-
enable_broker_on_windows=True)
29+
if sys.platform == "win32":
30+
pca = msal.PublicClientApplication(
31+
_AZURE_CLI,
32+
authority="https://login.microsoftonline.com/organizations",
33+
enable_broker_on_windows=True)
34+
elif sys.platform == "darwin":
35+
pca = msal.PublicClientApplication(
36+
_AZURE_CLI,
37+
authority="https://login.microsoftonline.com/organizations",
38+
enable_broker_on_mac=True)
39+
else:
40+
print("Platform not supported yet.")
41+
exit()
3242

3343
def interactive_and_silent(scopes, auth_scheme, data, expected_token_type):
3444
print("An account picker shall be pop up, possibly behind this console. Continue from there.")

0 commit comments

Comments
 (0)