]> git.ipfire.org Git - thirdparty/squid.git/blame - helpers/basic_auth/LDAP/basic_ldap_auth.8
Update manuals after helper changes
[thirdparty/squid.git] / helpers / basic_auth / LDAP / basic_ldap_auth.8
CommitLineData
428744a1 1.TH basic_ldap_auth 8 "14 January 2005" "Squid LDAP Auth"
b3def772 2.
cfca18fc 3.SH NAME
428744a1 4basic_ldap_auth - LDAP authentication helper for Squid
b3def772 5.
cfca18fc 6.SH SYNOPSIS
428744a1 7.B basic_ldap_auth
b627c18a 8-b "base DN" [-u attribute] [options] [ldap_server_name[:port]|URI]...
9.br
428744a1 10.B basic_ldap_auth
b627c18a 11-b "base DN" -f "LDAP search filter" [options] [ldap_server_name[:port]|URI]...
b3def772 12.
cfca18fc 13.SH DESCRIPTION
14This helper allows Squid to connect to a LDAP directory to
15validate the user name and password of Basic HTTP authentication.
076d1037 16LDAP options are specified as parameters on the command line,
17while the username(s) and password(s) to be checked against the
18LDAP directory are specified on subsequent lines of input to the
19helper, one username/password pair per line separated by a space.
20.P
21As expected by the basic authentication construct of Squid, after
22specifying a username and password followed by a new line, this
23helper will produce either OK or ERR on the following line
24to show if the specified credentials are correct according to
25the LDAP directory.
b3def772 26.P
27The program has two major modes of operation. In the default mode
28of operation the users DN is constructed using the base DN and
29user attribute. In the other mode of operation a search
30filter is used to locate valid user DN's below the base DN.
31.
428744a1
AJ
32.SH OPTIONS
33.
cfca18fc 34.TP
35.BI "-b " "basedn " (REQUIRED)
36Specifies the base DN under which the users are located.
b3def772 37.
cfca18fc 38.TP
39.BI "-f " filter
2fd77e91 40LDAP search filter to locate the user DN. Required if the users
41are in a hierarchy below the base DN, or if the login name is
42not what builds the user specific part of the users DN.
cfca18fc 43.IP
2fd77e91 44The search filter can contain up to 15 occurrences of %s
cfca18fc 45which will be replaced by the username, as in "uid=%s" for
b3def772 46RFC2037 directories. For a detailed description of LDAP search
47filter syntax see RFC2254.
48.
cfca18fc 49.TP
50.BI "-u " userattr
b3def772 51Specifies the name of the DN attribute that contains the username/login.
52Combined with the base DN to construct the users DN when no search filter
53is specified (-f option). Defaults to 'uid'
cfca18fc 54.IP
b3def772 55Note: This can only be done if all your users are located directly under
56the same position in the LDAP tree and the login name is used for naming
57each user object. If your LDAP tree does not match these criterias or if
58you want to filter who are valid users then you need to use a search filter
59to search for your users DN (-f option).
60.
cfca18fc 61.TP
b627c18a 62.BI "-U " passwordattr
63Use ldap_compare instead of ldap_simple_bind to verify the users password.
64passwordattr is the LDAP attribute storing the users password.
65.
66.TP
cfca18fc 67.BI "-s " base|one|sub
68search scope when performing user DN searches specified
b3def772 69by the -f option. Defaults to 'sub'.
cfca18fc 70.IP
71.B base
72object only,
73.B one
74level below the base object or
75.BR sub tree
76below the base object
77.
78.TP
79.BI "-D " "binddn " "-w " password
80The DN and password to bind as while performing searches. Required by the
81.BI -f
82flag if the directory does not allow anonymous searches.
83.IP
84As the password needs to be printed in plain text in your Squid configuration
2fd77e91 85it is strongly recommended to use a account with minimal associated privileges.
cfca18fc 86This to limit the damage in case someone could get hold of a copy of your
87Squid configuration file.
b3def772 88.
cfca18fc 89.TP
954a8513 90.BI "-D " "binddn " "-W " "secretfile "
91The DN and the name of a file containing the password
92to bind as while performing searches.
93.IP
94Less insecure version of the former parameter pair with two advantages:
95The password does not occur in the process listing,
96and the password is not being compromised if someone gets the squid
97configuration file without getting the secretfile.
98.
99.TP
70c46401 100.BI -P
cfca18fc 101Use a persistent LDAP connection. Normally the LDAP connection
102is only open while validating a username to preserve resources
103at the LDAP server. This option causes the LDAP connection to
104be kept open, allowing it to be reused for further user
105validations. Recommended for larger installations.
b3def772 106.
cfca18fc 107.TP
b627c18a 108.BI -O
109Only bind once per LDAP connection. Some LDAP servers do not
110allow re-binding as another user after a successful ldap_bind.
111The use of this option always opens a new connection for each
112login attempt. If combined with the -P option for persistent
113LDAP connection then the connection used for searching for the
114user DN is kept persistent but a new connection is opened
115to verify each users password once the DN is found.
116.
117.TP
cfca18fc 118.BI -R
119do not follow referrals
b3def772 120.
cfca18fc 121.TP
122.BI "-a " never|always|search|find
b3def772 123when to dereference aliases. Defaults to 'never'
cfca18fc 124.IP
125.BI never
126dereference aliases (default),
127.BI always
128dereference aliases, only while
129.BR search ing
130or only to
131.B find
132the base object
b3def772 133.
70c46401 134.TP
7ba68818 135.BI -H " ldapuri"
b627c18a 136Specity the LDAP server to connect to by LDAP URI (requires OpenLDAP libraries).
137Servers can also be specified last on the command line.
7ba68818 138.
139.TP
20b6fc8e 140.BI -h " ldapserver"
b627c18a 141Specify the LDAP server to connect to. Servers can also be specified last
142on the command line.
20b6fc8e 143.TP
70c46401 144.BI -p " ldapport"
b3def772 145Specify an alternate TCP port where the ldap server is listening if
b627c18a 146other than the default LDAP port 389. Can also be specified within the
147server specificiation by using servername:port syntax.
cfca18fc 148.
653b264e 149.TP
076d1037 150.BI -v " 2|3"
151LDAP protocol version. Defaults to 2 if not specified.
152.
153.TP
653b264e 154.BI -Z
155Use TLS encryption
156.
157.TP
158.BI -S certpath
159Enable LDAP over SSL (requires Netscape LDAP API libraries)
160.
161.TP
162.BI -c connect_timeout
163Specify timeout used when connecting to LDAP servers (requires
164Netscape LDAP API libraries)
165.TP
166.BI -t search_timeout
167Specify time limit on LDAP search operations
168.
307228f1 169.TP
b627c18a 170.BI -d
307228f1 171Debug mode where each step taken will get reported in detail.
172Useful for understanding what goes wrong if the results is
173not what is expected.
174.
cfca18fc 175.SH EXAMPLES
176For directories using the RFC2307 layout with a single domain, all
177you need to specify is usually the base DN under where your users
b3def772 178are located and the server name:
cfca18fc 179.IP
428744a1 180basic_ldap_auth -b "ou=people,dc=your,dc=domain" ldapserver
cfca18fc 181.P
b3def772 182If you have sub-domains then you need to use a search filter approach
183to locate your user DNs as these can no longer be constructed direcly
184from the base DN and login name alone:
cfca18fc 185.IP
428744a1 186basic_ldap_auth -b "dc=your,dc=domain" -f "uid=%s" ldapserver
cfca18fc 187.P
b3def772 188And similarily if you only want to allow access to users having a
189specific attribute
190.IP
428744a1 191basic_ldap_auth -b "dc=your,dc=domain" -f "(&(uid=%s)(specialattribute=value))" ldapserver
b3def772 192.P
2fd77e91 193Or if the user attribute of the user DN is "cn" instead of "uid" and
194you do not want to have to search for the users then you could use something
195like the following example for Active Directory:
cfca18fc 196.IP
428744a1 197basic_ldap_auth -u cn -b "cn=Users,dc=your,dc=domain" ldapserver
cfca18fc 198.P
2fd77e91 199If you want to search for the user DN and your directory does not allow
200anonymous searches then you must also use the -D and -w flags to specify
201a user DN and password to log in as to perform the searches, as in the
202following complex Active Directory example
cfca18fc 203.IP
428744a1 204basic_ldap_auth -P -R -b "dc=your,dc=domain" -D "cn=squid,cn=users,dc=your,dc=domain" -w "secretsquidpassword" -f "(&(userPrincipalName=%s)(objectClass=Person))" activedirectoryserver
b3def772 205.
206.SH NOTES
207.
208When constructing search filters it is strongly recommended to test the filter
428744a1 209using ldapsearch before you attempt to use basic_ldap_auth. This to verify
b3def772 210that the filter matches what you expect.
cfca18fc 211.
212.SH AUTHOR
213This manual page was written by
214.I Henrik Nordstrom <hno@squid-cache.org>
215.P
428744a1 216basic_ldap_auth is written by
cfca18fc 217.I Glenn Newton <gnewton@wapiti.cisti.nrc.ca>
218and
219.I Henrik Nordstrom <hno@squid-cache.org>
220.
221.SH KNOWN ISSUES
222Will crash if other % values than %s is used in -f, or if more than 15 %s
223is used.
224.
225.SH QUESTIONS
226Any questions on usage can be sent to
227.IR "Squid Users <squid-users@squid-cache.org>" ,
b3def772 228or to your favorite LDAP list/friend if the question is more related to
229LDAP than Squid.
cfca18fc 230.
231.SH REPORTING BUGS
232Report bugs or bug-fixes to
b3def772 233.I Squid Bugs <squid-bugs@squid-cache.org>
234or ideas for new improvements to
cfca18fc 235.I Squid Developers <squid-dev@squid-cache.org>
b3def772 236.
b3def772 237.SH "SEE ALSO"
238.BR ldapsearch ( 1 ),
239.br
240Your favorite LDAP documentation
241.br
242.BR RFC2254 " - The String Representation of LDAP Search Filters,"