Mercurial > prosody-modules
comparison mod_lib_ldap/README.wiki @ 1782:29f3d6b7ad16
Import wiki pages
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 24 Aug 2015 16:43:56 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
1781:12ac88940fe3 | 1782:29f3d6b7ad16 |
---|---|
1 #summary Library module for LDAP | |
2 | |
3 = Introduction = | |
4 | |
5 This module is used by other modules to access an LDAP server. It's pretty useless on its own; you should use it if you want to write your own LDAP-related module, or if you want to use one of mine ([mod_auth_ldap2], [mod_storage_ldap]). | |
6 | |
7 = Installation = | |
8 | |
9 Simply copy ldap.lib.lua into your Prosody installation's plugins directory. | |
10 | |
11 = Configuration = | |
12 | |
13 Configuration for this module (and all modules that use it) goes into the _ldap_ section of your prosody.cfg.lua file. Each plugin that uses it may add their own sections; this plugin relies on the following keys: | |
14 | |
15 * hostname - Where your LDAP server is located | |
16 * bind_dn - The DN to perform queries as | |
17 * bind_password - The password to use for queries | |
18 * use_tls - Whether or not TLS should be used to connect to the LDAP server | |
19 * user.usernamefield - The LDAP field that contains a user's username | |
20 * user.basedn - The base DN for user records | |
21 | |
22 = API = | |
23 | |
24 == ldap.getconnection() == | |
25 | |
26 Returns an LDAP connection object corresponding to the configuration in prosody.cfg.lua. The connection object is a [http://www.keplerproject.org/lualdap/ LuaLDAP] connection. | |
27 | |
28 == ldap.getparams() == | |
29 | |
30 Returns the LDAP configuration provided in prosody.cfg.lua. Use this if you want to stick some configuration information for your module into the LDAP section in the configuration file. | |
31 | |
32 == ldap.bind(username, password) == | |
33 | |
34 Verifies that _username_ and _password_ bind ok. *NOTE*: This does not bind the current LDAP connection to the given username! | |
35 | |
36 == ldap.singlematch(query) == | |
37 | |
38 Used to fetch a single LDAP record given an LDAP query. A convenience function. | |
39 | |
40 == ldap.filter.combine_and(...) == | |
41 | |
42 Takes a list of LDAP filter expressions and returns a filter expression that results in the intersection of each given expression (it ANDs them together). | |
43 | |
44 = More Information = | |
45 | |
46 For more information, please consult the README.md file under prosody-modules/mod_lib_ldap. |