From 96d34d4a57ef380e42b9be3cf6d95edbae9b8a62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20de=20CHAVIGNY?= Date: Sun, 4 Sep 2022 13:28:11 -0400 Subject: [PATCH] new ad ldap datasource with ldapts --- packages/server/src/integrations/adldap.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/packages/server/src/integrations/adldap.ts b/packages/server/src/integrations/adldap.ts index 1f673536d..17ab8ab07 100644 --- a/packages/server/src/integrations/adldap.ts +++ b/packages/server/src/integrations/adldap.ts @@ -91,13 +91,11 @@ module AdLdapModule { class AdLdapIntegration { private readonly config: AdLdapConfig - private client:any + constructor(config: AdLdapConfig) { this.config = config - - } @@ -141,7 +139,7 @@ module AdLdapModule { } async command(query: { bucket: string }) { return this.ldapContext(async () => { - this.client = new Client({ + const client = new Client({ url: this.config.url, timeout: 0, connectTimeout: 0, @@ -150,9 +148,9 @@ module AdLdapModule { }, strictDN: true, }) - console.log("Client crée :",this.client) - await this.client.bind(this.config.bindDN, this.config.secret); - if (this.client.isConnected) { + console.log("Client crée :",client) + await client.bind(this.config.bindDN, this.config.secret); + if (client.isConnected) { console.log("Client ldap connecté") } /*const response = await this.client.queryAttributes({ @@ -168,7 +166,7 @@ module AdLdapModule { const response = { result:'test'} console.log("Ldap users :",response) // always free-Up after you done the job! - this.client.unbind(); + client.unbind(); return response }) }