@@ -450,7 +450,7 @@ def __init__(
450
450
This factor would become mandatory
451
451
if a tenant's admin enables a corresponding Conditional Access (CA) policy.
452
452
The broker's presence allows Microsoft identity platform
453
- to have higher confidence that the tokens are being issued to your device,
453
+ to have more confidence that the tokens are being issued to your device,
454
454
and that is more secure.
455
455
456
456
An additional benefit of broker is,
@@ -459,29 +459,24 @@ def __init__(
459
459
so that your broker-enabled apps (even a CLI)
460
460
could automatically SSO from a previously established signed-in session.
461
461
462
- This parameter defaults to None, which means MSAL will not utilize a broker.
463
- If this parameter is set to True,
464
- MSAL will use the broker whenever possible,
465
- and automatically fall back to non-broker behavior.
466
- That also means your app does not need to enable broker conditionally,
467
- you can always set allow_broker to True,
468
- as long as your app meets the following prerequisite:
462
+ This parameter defaults to None, which means MSAL will not utilize a broker,
463
+ and your end users will have the traditional browser-based login experience.
469
464
470
- * Installed optional dependency, e.g. ``pip install msal[broker]>=1.20,<2``.
471
- (Note that broker is currently only available on Windows 10+)
465
+ You can set it to True, based on the OS platform.
466
+ Currently, MSAL supports broker on Windows 10+, and errors out on others.
467
+ So, for example, you can do ``allow_broker = sys.platform=="win32"``.
472
468
473
- * Register a new redirect_uri for your desktop app as:
474
- ``ms-appx-web://Microsoft.AAD.BrokerPlugin/your_client_id``
475
-
476
- * Tested your app in following scenarios:
469
+ In order to allow broker, your app must also meet the following prerequisite:
477
470
478
- * Windows 10+
471
+ * Install optional dependency, e.g. ``pip install msal[broker]>=1.20,<2``.
479
472
480
- * PublicClientApplication's following methods::
481
- acquire_token_interactive(), acquire_token_by_username_password(),
482
- acquire_token_silent() (or acquire_token_silent_with_error()).
473
+ * Register a new redirect_uri for your desktop app as:
474
+ ``ms-appx-web://Microsoft.AAD.BrokerPlugin/your_client_id``
483
475
484
- * AAD and MSA accounts (i.e. Non-ADFS, non-B2C)
476
+ * Test your app with AAD and MSA accounts (i.e. Non-ADFS, non-B2C)
477
+ in PublicClientApplication's following methods:
478
+ acquire_token_interactive(), acquire_token_by_username_password(),
479
+ acquire_token_silent() (or acquire_token_silent_with_error()).
485
480
486
481
New in version 1.20.0.
487
482
"""
@@ -549,6 +544,9 @@ def __init__(
549
544
)
550
545
else :
551
546
raise
547
+
548
+ if allow_broker and sys .platform != "win32" :
549
+ raise ValueError ("allow_broker=True is only supported on Windows" )
552
550
is_confidential_app = bool (
553
551
isinstance (self , ConfidentialClientApplication ) or self .client_credential )
554
552
if is_confidential_app and allow_broker :
0 commit comments