3 summary: Library module for LDAP
9 This module is used by other modules to access an LDAP server. It's
10 pretty useless on its own; you should use it if you want to write your
11 own LDAP-related module, or if you want to use one of mine
12 ([mod\_auth\_ldap2](mod_auth_ldap2.html),
13 [mod\_storage\_ldap](mod_storage_ldap.html)).
18 Simply copy ldap.lib.lua into your Prosody installation's plugins
24 Configuration for this module (and all modules that use it) goes into
25 the *ldap* section of your prosody.cfg.lua file. Each plugin that uses
26 it may add their own sections; this plugin relies on the following keys:
28 - hostname - Where your LDAP server is located
29 - bind\_dn - The DN to perform queries as
30 - bind\_password - The password to use for queries
31 - use\_tls - Whether or not TLS should be used to connect to the LDAP
33 - user.usernamefield - The LDAP field that contains a user's username
34 - user.basedn - The base DN for user records
42 Returns an LDAP connection object corresponding to the configuration in
43 prosody.cfg.lua. The connection object is a
44 [LuaLDAP](http://www.keplerproject.org/lualdap/) connection.
49 Returns the LDAP configuration provided in prosody.cfg.lua. Use this if
50 you want to stick some configuration information for your module into
51 the LDAP section in the configuration file.
53 ldap.bind(username, password)
54 -----------------------------
56 Verifies that *username* and *password* bind ok. **NOTE**: This does not
57 bind the current LDAP connection to the given username!
59 ldap.singlematch(query)
60 -----------------------
62 Used to fetch a single LDAP record given an LDAP query. A convenience
65 ldap.filter.combine\_and(...)
66 -----------------------------
68 Takes a list of LDAP filter expressions and returns a filter expression
69 that results in the intersection of each given expression (it ANDs them
75 For more information, please consult the README.html file under
76 prosody-modules/mod\_lib\_ldap.