AsyncLdapConnection

flitter-auth/ldap/AsyncLdapConnection~ AsyncLdapConnection

Asynchronous helper methods for the jdap.js library.


Constructor

new AsyncLdapConnection()

Methods

add(object, entry) → {Promise.<void>}

Create the object with the specified DN with the specified attributes.

Parameters:
Name Type Description
object string

fully-qualified DN of the object to be created

entry object

collection of attribute-value pairs for the object

Returns:
Type
Promise.<void>

add_to(object, entry) → {Promise.<void>}

Similar to modify, add the following attributes to the specified object. If they don't exist, the attributes will be created. If they do, the specified values will be appended to the existing attributes.

Parameters:
Name Type Description
object string

fully qualified DN of the object to be modified

entry object

collection of key-value pairs to be set on the object

Returns:
Type
Promise.<void>

bind(dn, password, controls) → {Promise.<module:flitter-auth/ldap/AsyncLdapConnection~AsyncLdapConnection>}

Bind the active connection to the specified DN with the password.

Parameters:
Name Type Description
dn string

the fully-qualified bind DN

password string

the password to authenticate against

controls Array.<ldap/Control>

collection of controls to pass to ldap.js

Returns:
  • resolves to this if successful
Type
Promise.<module:flitter-auth/ldap/AsyncLdapConnection~AsyncLdapConnection>

compare(object, attribute, value) → {Promise.<boolean>}

Check if the specified attribute is equal to the value for the object with the fully-qualified object DN.

Parameters:
Name Type Description
object string

fully-qualified object DN

attribute string

attribute to compare

value *

value to match

Returns:
  • resolves true if the attribute matches the value
Type
Promise.<boolean>

delete(object) → {Promise.<void>}

Delete the object with the specified DN.

Parameters:
Name Type Description
object string

fully-qualified DN of the object to be deleted

Returns:
Type
Promise.<void>

modify(object, entry) → {Promise.<void>}

Modify the values of the specified object.

Parameters:
Name Type Description
object string

fully qualified DN of the object to be modified

entry object

collection of key-value pairs to set on the object

Returns:
Type
Promise.<void>

password_check(object, password) → {Promise.<boolean>}

Check if the specified value can authenticate the user with the fully-qualified DN.

Parameters:
Name Type Description
object string

fully-qualified DN of the user to bind

password string

password to check

Returns:
  • true if authentication succeeds
Type
Promise.<boolean>

password_reset(object, password) → {Promise.<void>}

Reset the userPassword of the specified bind object by SSHA hashing the specified password.

Parameters:
Name Type Description
object string

fully-qualified DN of the user to reset

password string

the password to set

Returns:
Type
Promise.<void>

Search for all objects in the specified base, covered by the filter, for the specified attributes.

Parameters:
Name Type Description
base string

fully-qualified base to search

filter string

LDAP-compliant string to filter items

attributes Array.<string>

object attributes to fetch

Returns:
  • collection of matches
Type
Promise.<Array.<object>>