(type egg)
(signature "ldap-bind egg")
(timestamp 1612269487)
(sxml ((section 2 "Outdated egg!" (p "This is an egg for CHICKEN 4, the unsupported old release.  You're almost certainly looking for " (int-link "/eggref/5/ldap-bind" "the CHICKEN 5 version of this egg") ", if it exists.") (p "If it does not exist, there may be equivalent functionality provided by another egg; have a look at the " (link "https://wiki.call-cc.org/chicken-projects/egg-index-5.html" "egg index") ". Otherwise, please consider porting this egg to the current version of CHICKEN.") (tags "egg")) (section 2 "ldap-bind" (toc) (section 3 "Description" (p "A CHICKEN egg implementing LDAP bind for authentication purposes using the OpenLDAP library. This is not a complete binding to the OpenLDAP library and only covers the authentication use-case.") (p "Requires OpenLDAP / libldap and liblber to be installed.")) (section 3 "API" (def (sig (procedure "(ldap-initialize uris #!optional (version 3))" (id ldap-initialize))) (p "Initializes the LDAP library and opens a connection to an LDAP server. Returns an ldap-connection record.")) (def (sig (procedure "(ldap-bind conn dn pass)" (id ldap-bind))) (p "Attempts to bind to a dn using the given password. The conn argument is a connection record returned from ldap-initialize. Returns #t if the bind succeeded, #f otherwise.")) (def (sig (procedure "(ldap-unbind conn)" (id ldap-unbind))) (p "Terminate the current association, and free the resources contained in the connecction record. After calling ldap-unbind the connection to the LDAP server is closed and the connection record becomes invalid."))) (section 3 "Example" (highlight scheme "(use ldap-bind)\n\n(define ld (ldap-initialize \"ldaps://example.com\"))\n\n(if (ldap-bind ld \"uid=testuser,cn=users,dc=example,dc=com\" \"password\")\n  (print \"Welcome, authenticated user!\")\n  (print \"Invalid Credentials\"))\n\n;; or, using list syntax for a base dn:\n\n(define base-dn\n  '((cn \"users\") (dc \"example\") (dc \"com\")))\n\n(if (ldap-bind ld (cons '(uid \"testuser\") base-dn) \"password\")\n  (print \"Welcome, authenticated user!\")\n  (print \"Invalid Credentials\"))\n\n(ldap-unbind ld)")) (section 3 "Author" (p "Original implementation work by Moritz Heidkamp, updated to latest APIs and released with just the ldap-bind feature by Caolan McMahon (with kind permission).")))))
