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