mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-04 17:23:45 -05:00
Fix ADAL to MSAL transition of connections and account list (#21425)
This commit is contained in:
@@ -899,7 +899,9 @@ export class ConnectionManagementService extends Disposable implements IConnecti
|
||||
const azureAccounts = accounts.filter(a => a.key.providerId.startsWith('azure'));
|
||||
if (azureAccounts && azureAccounts.length > 0) {
|
||||
let accountId = (connection.authenticationType === Constants.AuthenticationType.AzureMFA || connection.authenticationType === Constants.AuthenticationType.AzureMFAAndUser) ? connection.azureAccount : connection.userName;
|
||||
let account = azureAccounts.find(account => account.key.accountId === accountId);
|
||||
// For backwards compatibility with ADAL, we need to check if the account ID matches with tenant Id or just the account ID
|
||||
// The OR case can be removed once we no longer support ADAL
|
||||
let account = azureAccounts.find(account => account.key.accountId === accountId || account.key.accountId.split('.')[0] === accountId);
|
||||
if (account) {
|
||||
this._logService.debug(`Getting security token for Azure account ${account.key.accountId}`);
|
||||
if (account.isStale) {
|
||||
|
||||
Reference in New Issue
Block a user