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