LDAP Authentication

Enamel provides an LDAP authentication object. It accepts a standard LDAP URI and requires a bind dn and password.

from enamel import authentication, servers, pages
import enamel
class LDAPAuthApp(enamel.Enamel):
    indexPage = SomeIndex
    loginPage = pages.Login
    anonymousAccess = False

    authenticator = authentication.LDAPAuthenticator
    ldapAuthUrl = "ldap://localhost:389/dc=test,dc=co,dc=za,o=ORG?uid?sub?"
    ldapAuthDn = "cn=Manager, o=ORG"
    ldapBindPassword = "password"

    server = servers.TwistedWeb
    port = 8080

LDAPAuthenticator uses a deferred thread for authentication calls. It makes use of ldaputil.passwd by Michael Stroeder which is provided under the GPL2. It requires the python-ldap library to be installed for it's use.