Fixes the azure auth for postgresql (#10662)

This commit is contained in:
Amir Omidi
2020-06-04 16:01:50 -07:00
committed by GitHub
parent 6b7c286891
commit 70af4cbe42

View File

@@ -813,7 +813,7 @@ export class ConnectionManagementService extends Disposable implements IConnecti
const accounts = await this._accountManagementService.getAccounts(); const accounts = await this._accountManagementService.getAccounts();
const azureAccounts = accounts.filter(a => a.key.providerId.startsWith('azure')); const azureAccounts = accounts.filter(a => a.key.providerId.startsWith('azure'));
if (azureAccounts && azureAccounts.length > 0) { if (azureAccounts && azureAccounts.length > 0) {
let accountName = (connection.authenticationType === Constants.azureMFA) ? connection.azureAccount : connection.userName; let accountName = (connection.authenticationType === Constants.azureMFA || connection.authenticationType === Constants.azureMFAAndUser) ? connection.azureAccount : connection.userName;
let account = find(azureAccounts, account => account.key.accountId === accountName); let account = find(azureAccounts, account => account.key.accountId === accountName);
if (account) { if (account) {
this._logService.debug(`Getting security token for Azure account ${account.key.accountId}`); this._logService.debug(`Getting security token for Azure account ${account.key.accountId}`);