From 00fff6ededd17b7262636208427a8b0618052d55 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 11 Jul 2023 12:35:00 +0200 Subject: [PATCH] Add local AD option --- .../server/src/integrations/microsoftSqlServer.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/server/src/integrations/microsoftSqlServer.ts b/packages/server/src/integrations/microsoftSqlServer.ts index 17cbf10e90..fe2222a2e0 100644 --- a/packages/server/src/integrations/microsoftSqlServer.ts +++ b/packages/server/src/integrations/microsoftSqlServer.ts @@ -28,7 +28,8 @@ const DEFAULT_SCHEMA = "dbo" import { ConfidentialClientApplication } from "@azure/msal-node" enum MSSQLConfigAuthType { - ACTIVE_DIRECTORY = "Active Directory", + AZURE_ACTIVE_DIRECTORY = "Azure Active Directory", + LOCAL_ACTIVE_DIRECTORY = "Local Active Directory", } interface MSSQLConfig { @@ -93,13 +94,18 @@ const SCHEMA: Integration = { authType: { type: DatasourceFieldType.SELECT, display: "Advanced auth", - config: { options: [MSSQLConfigAuthType.ACTIVE_DIRECTORY] }, + config: { + options: [ + MSSQLConfigAuthType.AZURE_ACTIVE_DIRECTORY, + MSSQLConfigAuthType.LOCAL_ACTIVE_DIRECTORY, + ], + }, }, adConfig: { type: DatasourceFieldType.FIELD_GROUP, default: true, display: "Configure Active Directory", - hidden: "'{{authType}}' !== 'Active Directory'", + hidden: `'{{authType}}' !== '${MSSQLConfigAuthType.AZURE_ACTIVE_DIRECTORY}'`, config: { openByDefault: true, nestedFields: true, @@ -199,7 +205,7 @@ class SqlServerIntegration extends Sql implements DatasourcePlus { } delete clientCfg.encrypt - if (this.config.authType === MSSQLConfigAuthType.ACTIVE_DIRECTORY) { + if (this.config.authType === MSSQLConfigAuthType.AZURE_ACTIVE_DIRECTORY) { const { clientId, tenantId, clientSecret } = this.config.adConfig! const clientApp = new ConfidentialClientApplication({ auth: {