@@ -1747,7 +1747,7 @@ def __init__(self, client_id, client_credential=None, **kwargs):
1747
1747
1748
1748
You may set enable_broker_on_windows to True.
1749
1749
1750
- What is a broker, and why use it?
1750
+ ** What is a broker, and why use it?**
1751
1751
1752
1752
A broker is a component installed on your device.
1753
1753
Broker implicitly gives your device an identity. By using a broker,
@@ -1764,10 +1764,7 @@ def __init__(self, client_id, client_credential=None, **kwargs):
1764
1764
so that your broker-enabled apps (even a CLI)
1765
1765
could automatically SSO from a previously established signed-in session.
1766
1766
1767
- ADFS and B2C do not support broker.
1768
- MSAL will automatically fallback to use browser.
1769
-
1770
- You shall only enable broker when your app:
1767
+ **You shall only enable broker when your app:**
1771
1768
1772
1769
1. is running on supported platforms,
1773
1770
and already registered their corresponding redirect_uri
@@ -1780,6 +1777,29 @@ def __init__(self, client_id, client_credential=None, **kwargs):
1780
1777
1781
1778
3. tested with ``acquire_token_interactive()`` and ``acquire_token_silent()``.
1782
1779
1780
+ **The fallback behaviors of MSAL Python's broker support**
1781
+
1782
+ MSAL will either error out, or silently fallback to non-broker flows.
1783
+
1784
+ 1. MSAL will ignore the `enable_broker_...` and bypass broker
1785
+ on those auth flows that are known to be NOT supported by broker.
1786
+ This includes ADFS, B2C, etc..
1787
+ For other "could-use-broker" scenarios, please see below.
1788
+ 2. MSAL errors out when app developer opted-in to use broker
1789
+ but a direct dependency "mid-tier" package is not installed.
1790
+ Error message guides app developer to declare the correct dependency
1791
+ ``msal[broker]``.
1792
+ We error out here because the error is actionable to app developers.
1793
+ 3. MSAL silently "deactivates" the broker and fallback to non-broker,
1794
+ when opted-in, dependency installed yet failed to initialize.
1795
+ We anticipate this would happen on a device whose OS is too old
1796
+ or the underlying broker component is somehow unavailable.
1797
+ There is not much an app developer or the end user can do here.
1798
+ Eventually, the conditional access policy shall
1799
+ force the user to switch to a different device.
1800
+ 4. MSAL errors out when broker is opted in, installed, initialized,
1801
+ but subsequent token request(s) failed.
1802
+
1783
1803
:param boolean enable_broker_on_windows:
1784
1804
This setting is only effective if your app is running on Windows 10+.
1785
1805
This parameter defaults to None, which means MSAL will not utilize a broker.
0 commit comments