@@ -982,7 +982,7 @@ def get_accounts(self, username=None):
982
982
# In Cloud Shell, user already signed in w/ an account [email protected]
983
983
# We pretend we have that account, for acquire_token_silent() to work.
984
984
# Note: If user calls acquire_token_by_xyz() with same account later,
985
- # the get_accounts() would return multiple accounts to calling app ,
985
+ # the get_accounts(username=None ) would return multiple accounts,
986
986
# with different usernames: [email protected] and CURRENT_USER.
987
987
accounts .insert (0 , cloud_shell_pseudo_account )
988
988
# Does not further filter by existing RTs here. It probably won't matter.
@@ -1149,20 +1149,7 @@ def acquire_token_silent_with_error(
1149
1149
assert isinstance (scopes , list ), "Invalid parameter type"
1150
1150
self ._validate_ssh_cert_input_data (kwargs .get ("data" , {}))
1151
1151
1152
- # TODO: TBD
1153
- # Currently, the following implementation activates Cloud Shell (CS) code path
1154
- # when a pseudo account was specified.
1155
- # But when/if the user signs in explicitly (such as "az login") with SAME account,
1156
- # to obtain tokens with scope(s) not supported by Cloud Shell's IMDS,
1157
- # the user would end up with one real account and still one pseudo account,
1158
- # both with same username.
1159
- # It would become unrealistic for end user to reason why
1160
- # the pseudo "default user" account would go one code path,
1161
- # and the real account would go another.
1162
- # I will probably refactor to automatically group Cloud Shell's default account
1163
- # and the real account into one, if they have same username.
1164
- # And then, acquire_token_silent() will always try real account if RT is available,
1165
- # and fallback to the Cloud Shell code path.
1152
+ # The special code path only for _CLOUD_SHELL_USER
1166
1153
if account and account .get ("home_account_id" ) == _CLOUD_SHELL_USER :
1167
1154
# Since we don't currently store cloud shell tokens in MSAL's cache,
1168
1155
# we can have a shortcut here, and semantically bypass all those
0 commit comments