@@ -470,9 +470,9 @@ def __init__(
470
470
self .http_client , validate_authority = False )
471
471
else :
472
472
raise
473
- is_public_app = ( isinstance ( self , PublicClientApplication ) or
474
- ( isinstance (self , ClientApplication ) and not self .client_credential ) )
475
- self ._enable_broker = (is_public_app
473
+ is_confidential_app = bool (
474
+ isinstance (self , ConfidentialClientApplication ) or self .client_credential )
475
+ self ._enable_broker = (not is_confidential_app
476
476
and sys .platform == "win32"
477
477
and not self .authority .is_adfs and not self .authority ._is_b2c )
478
478
@@ -1226,8 +1226,12 @@ def _acquire_token_silent_from_cache_and_possibly_refresh_it(
1226
1226
refresh_reason = msal .telemetry .FORCE_REFRESH # TODO: It could also mean claims_challenge
1227
1227
assert refresh_reason , "It should have been established at this point"
1228
1228
try :
1229
- if self ._enable_broker : # If interactive flow or ROPC were not through broker,
1230
- # the _acquire_token_silently() is unlikely to locate the account.
1229
+ if (
1230
+ self ._enable_broker
1231
+ # If interactive flow or ROPC were not through broker,
1232
+ # the _acquire_token_silently() is unlikely to locate the account.
1233
+ and account is not None # MSAL Python requires this
1234
+ ):
1231
1235
try :
1232
1236
from .wam import _acquire_token_silently
1233
1237
response = _acquire_token_silently (
0 commit comments