Results 1 to 3 of 3
This is driving me nuts. I started running a small linux server with a few ad-hoc services for our company, but then security got involved and now I need to ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 06-25-2007 #1Just Joined!
- Join Date
- Jan 2007
- Posts
- 19
LDAP Single-Sign-On?
This is driving me nuts. I started running a small linux server with a few ad-hoc services for our company, but then security got involved and now I need to implement password management. The lowest common denominator seems to be ldap, which is apparently the only thing that works with most web-based applications. What I want to do is use ldap to store username/password, and a few pieces of information about the users. Then, use groups to grant each user access to specific services available on the site, such as requirements-management, subversion, WebDAV, etc. This way, instead of a seperate list & login for every person for every service, I can just maintain a single logon system, which keeps security happy. I had also forced (using apache rewrite engine) all pages to use SSL, so that there would be no chance of potentially sensitive data running across the internet in the clear.
Sounds good, but now I go to google to find out how to configure it.
You're probably laughing right about now. Go right ahead: I should have known that configuration is always the hard part. So far, everything I've found for LDAP centers on using it for an address book. After several trials and errors, and four different gui tools, I finally settled on JXplorer and created a database that looks like this:
I have the mod_authz_ldap plug-in, which came with apache. I configured the ldap server like so:Code:domain: host.example.com organizational unit: users inetOrgPerson: username1 (+ user data) inetOrgPerson: username2 (+ user data) organizational unit: groups groupOfUniqueNames: groupname1 (+ group data) uniqueMember: username1 uniqueMember: username2
slapd.conf
And this seems to work. I can use the ldapadd & ldapmodify tools to populate the upper levels of the database (had to do that before I could use JXplorer) and I can connect to it as the root users.Code:# # See slapd.conf(5) for details on configuration options. # This file should NOT be world readable. # include /etc/openldap/schema/core.schema include /etc/openldap/schema/cosine.schema include /etc/openldap/schema/inetorgperson.schema include /etc/openldap/schema/nis.schema # Allow LDAPv2 client connections. This is NOT the default. allow bind_v2 # Do not enable referrals until AFTER you have a working directory # service AND an understanding of referrals. #referral ldap://root.openldap.org pidfile /var/run/slapd.pid argsfile /var/run/slapd.args defaultsearchbase dc=host,dc=example,dc=com # Load dynamic backend modules: # modulepath /usr/sbin/openldap # moduleload back_bdb.la # moduleload back_ldap.la # moduleload back_ldbm.la # moduleload back_passwd.la # moduleload back_shell.la # The next three lines allow use of TLS for encrypting connections using a # dummy test certificate which you can generate by changing to # /usr/share/ssl/certs, running "make slapd.pem", and fixing permissions on # slapd.pem so that the ldap user or group can read it. Your client software # may balk at self-signed certificates, however. # TLSCACertificateFile /usr/share/ssl/certs/ca-bundle.crt # TLSCertificateFile /usr/share/ssl/certs/slapd.pem # TLSCertificateKeyFile /usr/share/ssl/certs/slapd.pem # Sample security restrictions # Require integrity protection (prevent hijacking) # Require 112-bit (3DES or better) encryption for updates # Require 63-bit encryption for simple bind # security ssf=1 update_ssf=112 simple_bind=64 # Sample access control policy: # Root DSE: allow anyone to read it # Subschema (sub)entry DSE: allow anyone to read it # Other DSEs: # Allow self write access # Allow authenticated users read access # Allow anonymous users to authenticate # Directives needed to implement policy: # access to dn.base="" by * read # access to dn.base="cn=Subschema" by * read # access to * # by self write # by users read # by anonymous auth # # if no access controls are present, the default policy # allows anyone and everyone to read anything but restricts # updates to rootdn. (e.g., "access to * by * read") # # rootdn can always read and write EVERYTHING! ####################################################################### # ldbm and/or bdb database definitions ####################################################################### database bdb suffix "dc=host,dc=example,dc=com" rootdn "cn=root,dc=host,dc=example,dc=com" # Cleartext passwords, especially for the rootdn, should # be avoided. See slappasswd(8) and slapd.conf(5) for details. # Use of strong authentication encouraged. # rootpw secret # rootpw {crypt}ijFYNcSNctBYg rootpw xxxx # The database directory MUST exist prior to running slapd AND # should only be accessible by the slapd and slap tools. # Mode 700 recommended. directory /var/lib/ldap # Indices to maintain for this database index objectClass eq,pres index ou,cn,mail,surname,givenname eq,pres,sub index uidNumber,gidNumber,loginShell eq,pres index uid,memberUid eq,pres,sub index nisMapName,nisMapEntry eq,pres,sub # Replicas of this database #replogfile /var/lib/ldap/openldap-master-replog #replica host=ldap-1.example.com:389 starttls=critical # bindmethod=sasl saslmech=GSSAPI # authcId=host/ldap-master.example.com@EXAMPLE.COM
But now, I try to set up a very simple folder to be authenticated by ldap, containing just an index.html:
authz_ldap.conf (excerpt)
And I get the following error:Code:# Testing LDAP: <Location /test> AuthLDAPURL ldap://localhost/dc=host,dc=example,dc=com?uid AuthLDAPBindDN cn=root,dc=host,dc=example,dc=com AuthLDAPBindPassword xxxx require group cn=groupname1, ou=groups </Location>
https://host.example.com/test
There is, in fact, more in the server log:Code:Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Apache/2.0.52 (CentOS) Server at topo.miltecsystems.com Port 443
error.log (excerpt)
(from the last restart)Code:[Thu Jun 21 13:12:02 2007] [notice] caught SIGTERM, shutting down [Thu Jun 21 13:12:28 2007] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) [Thu Jun 21 13:12:29 2007] [notice] Digest: generating secret for digest authentication ... [Thu Jun 21 13:12:29 2007] [notice] Digest: done [Thu Jun 21 13:12:29 2007] [notice] LDAP: Built with OpenLDAP LDAP SDK [Thu Jun 21 13:12:29 2007] [notice] LDAP: SSL support unavailable [Thu Jun 21 13:12:29 2007] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads. [Thu Jun 21 13:12:30 2007] [notice] Apache/2.0.52 (CentOS) configured -- resuming normal operations
Google searches are turning up what looks like voodoo debugging instructions, everything from 'you have to have a certificate' to corrupted plugin.
Does anyone have any idea what I'm doing wrong here? Despite the fact that ldap is touted as an authentication framework, it seems almost no one has tutorials on how to use it for that purpose. I'm not looking to hook it up to any other ldap system, just to use it locally.
- 06-26-2007 #2
I cant help you specifically, while I run an LDAP server, I dont use it for web authentication. I can point you as the pages for Fedora Directory Server though; it has quite an extensive WIKI with configuration. It's all geared around FDS, but much of it should be translatable if you're using OpenLDAP. I'd recomend FDS over OpenLDAP any day, but that's my personal choice (based on the fact that it has a reasonable user interface).
Linux user #126863 - see http://linuxcounter.net/
- 06-26-2007 #3Just Joined!
- Join Date
- Jan 2007
- Posts
- 19
I may try it, but I don't know if it will work like I need it to or not.


Reply With Quote
