@@ -1747,7 +1747,7 @@ def __init__(self, client_id, client_credential=None, **kwargs):
17471747
17481748 You may set enable_broker_on_windows to True.
17491749
1750- What is a broker, and why use it?
1750+ ** What is a broker, and why use it?**
17511751
17521752 A broker is a component installed on your device.
17531753 Broker implicitly gives your device an identity. By using a broker,
@@ -1764,10 +1764,7 @@ def __init__(self, client_id, client_credential=None, **kwargs):
17641764 so that your broker-enabled apps (even a CLI)
17651765 could automatically SSO from a previously established signed-in session.
17661766
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:**
17711768
17721769 1. is running on supported platforms,
17731770 and already registered their corresponding redirect_uri
@@ -1780,6 +1777,29 @@ def __init__(self, client_id, client_credential=None, **kwargs):
17801777
17811778 3. tested with ``acquire_token_interactive()`` and ``acquire_token_silent()``.
17821779
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+
17831803 :param boolean enable_broker_on_windows:
17841804 This setting is only effective if your app is running on Windows 10+.
17851805 This parameter defaults to None, which means MSAL will not utilize a broker.
0 commit comments