Browse Source

new ad ldap datasource with ldapts

pull/7620/head
Hervé de CHAVIGNY 4 years ago
parent
commit
96d34d4a57
  1. 14
      packages/server/src/integrations/adldap.ts

14
packages/server/src/integrations/adldap.ts

@ -91,13 +91,11 @@ module AdLdapModule {
class AdLdapIntegration { class AdLdapIntegration {
private readonly config: AdLdapConfig private readonly config: AdLdapConfig
private client:any
constructor(config: AdLdapConfig) { constructor(config: AdLdapConfig) {
this.config = config this.config = config
} }
@ -141,7 +139,7 @@ module AdLdapModule {
} }
async command(query: { bucket: string }) { async command(query: { bucket: string }) {
return this.ldapContext(async () => { return this.ldapContext(async () => {
this.client = new Client({ const client = new Client({
url: this.config.url, url: this.config.url,
timeout: 0, timeout: 0,
connectTimeout: 0, connectTimeout: 0,
@ -150,9 +148,9 @@ module AdLdapModule {
}, },
strictDN: true, strictDN: true,
}) })
console.log("Client crée :",this.client) console.log("Client crée :",client)
await this.client.bind(this.config.bindDN, this.config.secret); await client.bind(this.config.bindDN, this.config.secret);
if (this.client.isConnected) { if (client.isConnected) {
console.log("Client ldap connecté") console.log("Client ldap connecté")
} }
/*const response = await this.client.queryAttributes({ /*const response = await this.client.queryAttributes({
@ -168,7 +166,7 @@ module AdLdapModule {
const response = { result:'test'} const response = { result:'test'}
console.log("Ldap users :",response) console.log("Ldap users :",response)
// always free-Up after you done the job! // always free-Up after you done the job!
this.client.unbind(); client.unbind();
return response return response
}) })
} }

Loading…
Cancel
Save