edgeport - v1.0.3
    Preparing search index...

    Function connect

    • Opens an LDAP connection, optionally upgrading to TLS and binding.

      When LdapConnectOptions.tls is 'implicit' the socket is TLS from the first byte; when 'starttls' the StartTLS extended operation runs and the socket is upgraded before any bind. If LdapConnectOptions.bindDN is set, a simple bind is performed before the session is returned.

      Parameters

      Returns Promise<LdapSession>

      A ready LdapSession.

      If a requested bind is rejected.

      If the connection or TLS upgrade fails.

      If the server misbehaves during StartTLS or bind.

      1.0.0

      await using session = await connect({
      hostname: 'ldap.example.com',
      bindDN: 'cn=admin,dc=example,dc=com',
      password: 'secret'
      });
      const users = await session.search({ base: 'dc=example,dc=com', filter: '(uid=jdoe)' });