Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #35027 > unrolled thread

python ldap bind error

Started byJorge Alberto Diaz Orozco <jaorozco@estudiantes.uci.cu>
First post2012-12-17 18:09 -0500
Last post2012-12-22 14:32 +0100
Articles 2 — 2 participants

Back to article view | Back to comp.lang.python


Contents

  python ldap bind error Jorge Alberto Diaz Orozco <jaorozco@estudiantes.uci.cu> - 2012-12-17 18:09 -0500
    Re: python ldap bind error Michael Ströder <michael@stroeder.com> - 2012-12-22 14:32 +0100

#35027 — python ldap bind error

FromJorge Alberto Diaz Orozco <jaorozco@estudiantes.uci.cu>
Date2012-12-17 18:09 -0500
Subjectpython ldap bind error
Message-ID<mailman.1002.1355786210.29569.python-list@python.org>
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@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'}

can someone help me???
I don't know what I'm doing wrong

10mo. ANIVERSARIO DE LA CREACION DE LA UNIVERSIDAD DE LAS CIENCIAS INFORMATICAS...
CONECTADOS AL FUTURO, CONECTADOS A LA REVOLUCION

http://www.uci.cu
http://www.facebook.com/universidad.uci
http://www.flickr.com/photos/universidad_uci

[toc] | [next] | [standalone]


#35361

FromMichael Ströder <michael@stroeder.com>
Date2012-12-22 14:32 +0100
Message-ID<kb4cpo$dg5$1@dont-email.me>
In reply to#35027
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@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@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.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web