I had originally started this from scratch but fortuitously discovered that Moritz Heidkamp had begun a similar project several years ago. I think originally planned as a complete binding to OpenLDAP, it was never released. I was able to take this well implemented base and update it to the latest APIs. Rather than support all the features of LDAP, this module lets you authenticate a user, and not much else.
The ldap-bind egg is available via the CHICKEN egg index:
You must also install OpenLDAP for the
(use ldap-bind) (define conn (ldap-initialize "ldaps://example.com")) (if (ldap-bind conn "uid=testuser,cn=users,dc=example,dc=com" "password") (print "Welcome, authenticated user!") (print "Invalid Credentials")) ;; or, using list syntax for a base dn: (define base-dn '((cn "users") (dc "example") (dc "com"))) (if (ldap-bind conn (cons '(uid "testuser") base-dn) "password") (print "Welcome, authenticated user!") (print "Invalid Credentials")) (ldap-unbind conn)