@@ -701,7 +701,7 @@ def _decide_broker(self, allow_broker, enable_pii_log):
701
701
702
702
def is_pop_supported (self ):
703
703
"""Returns True if this client supports Proof-of-Possession Access Token."""
704
- return self ._enable_broker
704
+ return self ._enable_broker and sys . platform != "linux"
705
705
706
706
def _decorate_scope (
707
707
self , scopes ,
@@ -1573,10 +1573,14 @@ def _acquire_token_silent_from_cache_and_possibly_refresh_it(
1573
1573
raise ValueError ("auth_scheme is not supported in Cloud Shell" )
1574
1574
return self ._acquire_token_by_cloud_shell (scopes , data = data )
1575
1575
1576
+ is_ssh_cert_or_pop_request = (
1577
+ data .get ("token_type" ) == "ssh-cert" or
1578
+ data .get ("token_type" ) == "pop" or
1579
+ isinstance (auth_scheme , msal .auth_scheme .PopAuthScheme ))
1576
1580
if self ._enable_broker and account and account .get ("account_source" ) in (
1577
1581
_GRANT_TYPE_BROKER , # Broker successfully established this account previously.
1578
1582
None , # Unknown data from older MSAL. Broker might still work.
1579
- ):
1583
+ ) and ( sys . platform != "linux" or not is_ssh_cert_or_pop_request ) :
1580
1584
from .broker import _acquire_token_silently
1581
1585
response = _acquire_token_silently (
1582
1586
"https://{}/{}" .format (self .authority .instance , self .authority .tenant ),
@@ -1823,7 +1827,7 @@ def acquire_token_by_username_password(
1823
1827
"""
1824
1828
claims = _merge_claims_challenge_and_capabilities (
1825
1829
self ._client_capabilities , claims_challenge )
1826
- if self ._enable_broker :
1830
+ if self ._enable_broker and sys . platform != "linux" :
1827
1831
from .broker import _signin_silently
1828
1832
response = _signin_silently (
1829
1833
"https://{}/{}" .format (self .authority .instance , self .authority .tenant ),
@@ -2134,6 +2138,10 @@ def acquire_token_interactive(
2134
2138
False
2135
2139
) and data .get ("token_type" ) != "ssh-cert" # Work around a known issue as of PyMsalRuntime 0.8
2136
2140
self ._validate_ssh_cert_input_data (data )
2141
+ is_ssh_cert_or_pop_request = (
2142
+ data .get ("token_type" ) == "ssh-cert" or
2143
+ data .get ("token_type" ) == "pop" or
2144
+ isinstance (auth_scheme , msal .auth_scheme .PopAuthScheme ))
2137
2145
if not on_before_launching_ui :
2138
2146
on_before_launching_ui = lambda ** kwargs : None
2139
2147
if _is_running_in_cloud_shell () and prompt == "none" :
@@ -2142,7 +2150,7 @@ def acquire_token_interactive(
2142
2150
return self ._acquire_token_by_cloud_shell (scopes , data = data )
2143
2151
claims = _merge_claims_challenge_and_capabilities (
2144
2152
self ._client_capabilities , claims_challenge )
2145
- if self ._enable_broker :
2153
+ if self ._enable_broker and ( sys . platform != "linux" or not is_ssh_cert_or_pop_request ) :
2146
2154
if parent_window_handle is None :
2147
2155
raise ValueError (
2148
2156
"parent_window_handle is required when you opted into using broker. "
@@ -2167,7 +2175,9 @@ def acquire_token_interactive(
2167
2175
)
2168
2176
return self ._process_broker_response (response , scopes , data )
2169
2177
2170
- if auth_scheme :
2178
+ if isinstance (auth_scheme , msal .auth_scheme .PopAuthScheme ) and sys .platform == "linux" :
2179
+ raise ValueError ("POP is not supported on Linux" )
2180
+ elif auth_scheme :
2171
2181
raise ValueError (self ._AUTH_SCHEME_UNSUPPORTED )
2172
2182
on_before_launching_ui (ui = "browser" )
2173
2183
telemetry_context = self ._build_telemetry_context (
0 commit comments