]> git.sur5r.net Git - openldap/blob - contrib/ldapsasl/README
Add note about not using ldapdb with slapd.
[openldap] / contrib / ldapsasl / README
1 LDAP auxprop plugin for SASL-enabled servers.
2 Copyright (C) 2002,2003 by Howard Chu, hyc@symas.com
3
4 This software is licensed under the terms of the OpenLDAP license.
5
6 The file ldapdb.c was written for Cyrus SASL 2.1.3 and OpenLDAP 2.1.3.
7 Due to various bugs in the Cyrus source you should use Cyrus SASL 2.1.15
8 or newer. The version of ldapdb bundled with OpenLDAP 2.1.22 and older
9 will work with all OpenLDAP releases 2.1.3 and up. The ldapdb in
10 OpenLDAP 2.1.23 uses a different LDAP request and requires the server
11 to be 2.1.23 or newer.
12
13 It can be compiled by copying into the Cyrus SASL source tree, in the
14 plugins subdirectory. No configuration or build script is provided.
15
16 To compile, type "make ldapdb.lo". To link, you'll have to copy the
17 link rule for one of the other plugins. Below is a sample on my Linux
18 system:
19
20         /bin/sh ../libtool --mode=link gcc  -Wall -W -g -O2 -L/usr/local/lib -Wl,-rpath,/usr/local/lib -module -export-dynamic -rpath /usr/lib/sasl2 -o libldapdb.la  -version-info 2:4:0 ldapdb.lo -lldap -llber -lssl -lcrypto
21
22 Once installed, you need to add some config items to the SASL server's
23 config file in /usr/lib/sasl2. For example:
24
25 ldapdb_uri: ldap://ldap.example.com
26 ldapdb_id: root
27 ldapdb_pw: secret
28 ldapdb_mech: DIGEST-MD5
29
30 This config assumes an LDAP server on the same machine as the server
31 that is using SASL. The LDAP server must be configured to map the SASL
32 authcId "root" into a DN that has proxy authorization privileges to
33 every account that is allowed to login to this server. (See the OpenLDAP
34 Admin Guide section 10 for details.)
35
36 Unlike other LDAP-enabled plugins for other services that are common
37 on the web, this plugin does not require you to configure DN search
38 patterns to map usernames to LDAP DNs. This plugin requires SASL name
39 mapping to be configured on the target slapd. This approach keeps the
40 LDAP-specific configuration details in one place, the slapd.conf, and
41 makes the configuration of remote services much simpler.
42
43 An additional keyword "ldapdb_rc" may be specified in the config file.
44 The filename specified here will be put into the server's LDAPRC
45 environment variable, and libldap-specific config options may be set
46 in that ldaprc file. The main purpose behind this option is to allow
47 a client TLS certificate to be configured, so that SASL/EXTERNAL may
48 be used between the SASL server and the LDAP server. This is the most
49 optimal way to use this plugin when the servers are on separate machines.
50
51 Note: this plugin is not for use with slapd itself. When OpenLDAP is
52 built with SASL support, slapd uses its own internal auxprop module.
53 By default, without configuring anything else, slapd will fail to load
54 the ldapdb module when it's present. This is as it should be. If you
55 don't like the "auxpropfunc: error -7" message that is sent to syslog
56 by slapd, you can stop it by creating /usr/lib/sasl2/slapd.conf with:
57
58         auxprop_plugin: slapd
59
60 which will force the SASL library to ignore all other auxprop modules.
61
62 This plugin has been in use for over a year at many sites with good
63 results. If you have questions or problems, please send feedback via
64 the openldap-software mailing list.
65
66   -- Howard Chu
67
68 Update... With OpenLDAP 2.1.13 you can use SASL/EXTERNAL on ldapi://.
69 This is fast and secure, and needs no username or password to be stored.
70 The SASL config file is just
71
72 ldapdb_uri: ldapi://
73 ldapdb_mech: EXTERNAL
74
75 The slapd.conf will need to map these usernames to LDAP DNs:
76
77 sasl-regexp uidNumber=(.*)\\+gidNumber=(.*),cn=peercred,cn=external,cn=auth
78         ldap:///dc=example,dc=com??sub?(&(uidNumber=$1)(gidNumber=$2))
79
80 sasl-regexp uid=(.*),cn=external,cn=auth
81         ldap:///dc=example,dc=com??sub?(uid=$1)
82
83 Update... With OpenLDAP 2.1.23 you can use the ldapdb_starttls keyword
84 to use the StartTLS extended operation on an LDAP session. This item
85 may be set to either "try" or "demand", e.g.:
86
87 ldapdb_uri: ldap://ldap.example.com
88 ldapdb_starttls: try
89
90 When set to "try" any failure in StartTLS is ignored. When set to "demand"
91 then any failure aborts the connection.