python ldap bind error

Michael Ströder michael at stroeder.com
Sat Dec 22 14:32:39 CET 2012


Jorge Alberto Diaz Orozco wrote:
> hi there.
> I'm working with python ldap and I need to authenticate my user.
> this is the code I'm using.
> 
> import ldap
> ldap.set_option(ldap.OPT_REFERRALS,0)
> ldap.protocol_version = 3
> conn = ldap.initialize("ldap://ldap.domain.cu")
> conn.simple_bind_s("user at domain.cu","password")
> 
> every time I do this it gives me the next error:
> ldap.INVALID_DN_SYNTAX: {'info': 'invalid DN', 'desc': 'Invalid DN syntax'}

"user at domain.cu" is not a DN as required in RFC 4511:

http://tools.ietf.org/html/rfc4511#section-4.2

MS AD directly accepts a userPrincipalName but this is a highly proprietary
feature => search the user's entry first.

Ciao, Michael.




More information about the Python-list mailing list