Add support for the Ldap-Group attribute in the ldap module
[freeradius.git] / doc / rlm_ldap
1 1.   INSTALATION
2
3 This module depends on OpenLDAP v2.x SDK libraries.
4 For details on obtaining source of OpenLDAP look at <http://www.openldap.org>.
5 OpenLDAP SDK in turn depends on OpenSSL crypto libraries and (optionaly) on 
6 Cyrus-SASL libraries.
7
8 2. CONFIGURATION
9
10 Add following subsection to the modules{} section of radiusd.conf to control
11 the rlm_ldap module:
12
13   modules {
14         ...
15         
16         ldap {
17
18 #       server: space separated list of host[:port]
19 #       default: settings for your system, as set in etc/openldap/ldap.conf
20 #
21                 server   = localhost
22
23 #       net_timeout: # of seconds to wait for response of the server 
24 #                       (network failures)
25 #       default: 10
26 #
27                 net_timeout = 1
28
29 #       timeout: # seconds to wait for LDAP query to finish
30 #       default: 20
31 #
32                 timeout = 2
33
34 #       timelimit: # of seconds server has to process the query 
35 #                       (server-side time limit)
36 #       default: 20
37 #
38                 timelimit = 5
39
40 #       ldap_debug: debug flag for LDAP SDK (see OpenLDAP documentation)
41 #       default: 0x0000 (no debugging messages)
42 #       Example:(LDAP_DEBUG_FILTER+LDAP_DEBUG_CONNS)
43                 ldap_debug = 0x0028 
44
45 #       identity: DN under which LDAP searches are done
46 #       password: pasword which authenticate this DN
47 #       default: anonymous bind, no password required
48 #       NOTE: searches are done now over unencrypted connection!
49 #
50 #       identity = "cn=admin,o=My Org,c=UA"
51 #       password = mypass
52
53 #       ldap_cache_timeout: The timeout for the ldap cache in secs
54 #       If it is set to zero then ldap caching will be disabled
55 #       default: 0 (disabled)
56
57         ldap_cache_timeout = 0
58
59 #       ldap_cache_size: The maximum ldap cache size. If it is set to zero
60 #       then the ldap cache size will be unlimited
61 #       default: 0
62
63         ldap_cache_size = 0
64
65 #       ldap_connections_number: The number of ldap connections that the module
66 #       will keep open to use in requests. Usually it will not need to be larger
67 #       than 5-10 connections
68 #       default: 5
69
70         ldap_connections_number = 5
71
72 #       basedn = <Base of LDAP searches>
73 #
74                 basedn   = "o=My Org,c=UA"
75
76 #       filter: LDAP search filter, to locate user object using name
77 #       supplied by client during Radius authentication
78 #       
79 #       default: 
80 #               filter   = "(uid=%u)"
81
82 #       default_profile: DN of a LDAP object, which contains default RADIUS 
83 #       attributes. 
84 #       default: NULL - use only user specific attributes or attributes, 
85 #       supplied by other modules.
86 #               
87         default_profile = "cn=RadProfile,o=My Org,c=UA"
88
89 #       profile_attribute: user object attribute, which contains DN of 
90 #       radiusProfile object for this user.
91 #       default: NULL - use only user specific attributes or attributes,
92 #       supplied by other modules.
93 #
94 #       profile_attribute = "radiusProfileDn"
95
96 #       access_group: membership in this group controls radius access for user
97 #       default: NULL 
98 #       (means all users located in the LDAP tree under specified "basedn")
99 #       
100                 access_group = "cn=RemoteUsers,o=My Org,c=UA"
101
102 #       access_attr: if attribute is specified, module checks for its existance
103 #       in user object. If it exists and is set to TRUE, user is allowed to get
104 #       remote access.
105 #       default: NULL - don't check for the attribute
106                 access_attr = "dialupAccess"
107
108 #       password_header: If the user password is available we add it to the check items
109 #       (to assist in CHAP ie) striping any headers first.
110 #       default: NULL
111 #
112 #       password_header = "{clear}"
113
114 #       password_attribute: Define the attribute which contains the user password.
115 #       default: NULL - don't add password
116 #
117 #       password_attribute = "userPassword"
118
119 #       groupname_attribute: The attribute used for searching for a group in the ldap server.
120 #       default: cn - Search filter is "(cn=%GroupName)"
121 #
122 #       groupname_attribute = "cn"
123
124 #       groupmembership_filter: The filter to search for group membership of a particular user
125 #       after we have found the DN for the group.
126 #       default: (|(&(objectClass=GroupOfNames)(member=%{Ldap-UserDn}))(&(objectClass=GroupOfUniqueNames)(uniquemember=%{Ldap-UserDn})))
127 #
128 #       groupmembership_filter = "(|(&(objectClass=GroupOfNames)(member=%{Ldap-UserDn}))(&(objectClass=GroupOfUniqueNames)(uniquemember=%{Ldap-UserDn})))"      
129
130         }
131 }
132
133 NOTE:
134 As LDAP is case insensitive, you should probably also set "lower_user = yes" 
135 and "lower_time = before" in main section of radiusd.conf, to get limits on 
136 simultaneous logins working correctly. Otherwise, users will be able get large 
137 number of sessions, capitalizing parts of their login names.
138
139 MODULE MESSAGES:
140 On user rejection rlm_ldap will return the following module messages:
141
142 "rlm_ldap: User not found"
143 "rlm_ldap: Access Attribute denies access"
144 "rlm_ldap: User is not an access group member"
145 "rlm_ldap: Bind as user failed"
146
147 These messages will be visible in radius.log as aditional information in
148 "Login incorrect" and "Invalid user" log messages.
149
150 LDAP XLAT:
151 The ldap module now supports LDAP URLs in xlat strings. That is you can now
152 add LDAP URLs in the configuration options and hopefully shortly also in the
153 users file. The strings will be of the following form:
154
155 %{ldap:ldap:///dc=company,dc=com?uid?sub?uid=%u}
156
157 The requested attributes list MUST contain only ONE attribute. In case this attribute
158 is multi valued which value is returned is considered UNDEFINED.
159 Also, adding the host:port information SHOULD be avoided unless there are more than one
160 ldap module instances in which case the host,port information can be used to distinguish
161 which module will actually return the information (the xlat function will return NULL if
162 the host,port information does not correspond to the configured attributes).
163
164 USER PROFILE ATTRIBUTE:
165 The module can use the User-Profile attribute. If it is set, it will assume that it contains
166 the DN of a profile entry containing radius attributes. This entry will _replace_ the default
167 profile directive. That way we can use different profiles based on checks on the radius attributes
168 contained in the Access-Request packets. For example (users file):
169
170 DEFAULT Service-Type == Outbound-User, User-Profile := "uid=outbound-dialup,dc=company,dc=com"
171  
172
173 GROUP SUPPORT:
174 The module supports searching for ldap groups by use of the Ldap-Group attribute. As long as the module
175 has been instanciated it can be used to do group membership checks through other modules. For example in
176 the users file:
177
178 DEFAULT Ldap-Group == "disabled", Auth-Type := Reject
179         Reply-Message = "Sorry, you are not allowed to have dialup access"
180
181 DIRECTORY COMPATIBILITY NOTE:
182 If you use LDAP only for authorization and authentication (e.g. you can not
183  afford schema extention), I propose to set all necessary attributes in 
184 raddb/users file with following authorize section of radiusd.conf :
185
186 authorize { 
187         ldap {
188                 notfound = return
189         } 
190         files  
191 }