edgeport - v1.0.3
    Preparing search index...

    Interface LdapSession

    An LDAP session over a single connection.

    Obtain one from connect. It is an AsyncDisposable, so it can be scoped with await using to guarantee an unbind and socket close.

    1.0.0

    interface LdapSession {
        "[asyncDispose]"(): PromiseLike<void>;
        bind(dn: string, password: string): Promise<void>;
        close(): Promise<void>;
        findOne(opts: SearchOptions): Promise<LdapEntry | null>;
        search(opts: SearchOptions): Promise<LdapEntry[]>;
    }

    Hierarchy

    • AsyncDisposable
      • LdapSession
    Index
    • Returns PromiseLike<void>

    • Performs a simple bind with the given DN and password.

      Parameters

      • dn: string

        The bind DN.

      • password: string

        The password.

      Returns Promise<void>

      Resolves once the server accepts the bind.

      If the credentials are rejected (result code 49).

      For any other non-success result code.

    • Sends an unbind request and closes the connection.

      Returns Promise<void>

    • Runs a search capped at a single result and returns the first entry, or null if none match. Forces sizeLimit to 1 regardless of what opts carries.

      Parameters

      • opts: SearchOptions

        The search parameters; sizeLimit is overridden to 1.

      Returns Promise<LdapEntry | null>

      The first matching entry, or null when there are none.

      If the server returns a non-success result in SearchResultDone.