authentication - no errors

Michael Engelhart mengelhart at katahdinsoftware.com
Wed May 7 19:41:02 CEST 2003


I'm still losing my mind with why my python-ldap won't throw 
authentication errors when invalid passwords are passed

I removed all my openldap data from the /var/db/openldap directories 
and subdirectories and created a basic
slapd.conf file as shown here:

include         /etc/openldap/schema/core.schema
include         /etc/openldap/schema/cosine.schema
include         /etc/openldap/schema/nis.schema
include         /etc/openldap/schema/inetorgperson.schema
include         /etc/openldap/schema/misc.schema
pidfile         /var/run/slapd.pid
argsfile        /var/run/slapd.args
allows          bind_v2
schemacheck	off

database ldbm
suffix "o=number1customer.com"
rootdn "cn=Directory Manager,o=number1customer.com"

rootpw secret
directory /var/db/openldap/openldap-data/number1customer.com/
cachesize       1000000
dbcachesize     10000000
index uid,cn,sn,givenName pres,eq,sub
sizelimit       20000

access to *
	by self write
	by dn="cn=Directory Manager,o=number1customer.com" write
	by * none

Then did this code
import ldap
try:
         l = ldap.open("127.0.0.1")
         # you should  set this to ldap.VERSION2 if you're using a v2 
directory
         l.protocol_version = ldap.VERSION2
         username = "cn=bogus-cn, o=wrongcompany.com"
         password  = "sjadfkjasfjkl"
         l.simple_bind(username, password)
         print "got here"
except ldap.LDAPError, e:
         print e

This output "got here" with no exceptions.  I still can't figure out 
how to force python-ldap to throw an exception upon entering an invalid 
dn or password or combination thereof.

Any help would be greatly appreciated.   This is definitely a 
python-ldap issue because when I try and do an ldapsearch on the 
command line it gives an error message saying that the dn or password 
is invalid.

Any help or ideas of where to look would be greatly appreciated.   I'm 
running this on Mac OS X (Darwin).   Everything else works perfectly.

Mike






More information about the python-ldap mailing list