Thanks for your tip, Christoph. In this way I avoid the error.
Now I get:
No such LDAP user: steve


I created a simpleSecurityObject like this:

        dn: uid=steve,ou=pippoauth,dc=host,dc=com
        objectclass: account
        objectclass: simpleSecurityObject
        objectclass: top
        uid: steve
        userpassword: {MD5}p37yziKc4z7WS/xs87ekFw==

There is a entry in users table with user_name='steve' too.
And now I'm trying to logon using:

logname: steve
password: ******* (this is the above userpassword)

but i get always the same error:
No such LDAP user: steve

I'm not sure about using 'steve' as username. :-\

j

Christoph Zwerschke wrote:
Am 19.07.2011 16:43 schrieb jo:
I'm trying to configure LDAP in my tg 1.1, in this way:

I guess you're using the recipe here:
http://www.turbogears.org/1.1/docs/Identity/Recipes.html?authenticate-against-an-ldap-server#authenticate-against-an-ldap-server

The problem seems to be that the validate_password method of the custom identity does not catch the NO_SUCH_OBJECT error. Earlier LDAP versions probably just returned an empty list instead so that was not needed.

It should be easy to fix this. Edit the validate_password method of your custom identity provider (/home/jose/trunk/sicer/lib/identity.py)
and change the line

objects = ldapcon.result(rc)[1]

to

try:
objects = ldapcon.result(rc)[1]
except ldap.NO_SUCH_OBJECT:
objects = []

-- Christoph



--
Jose Soares
Sferacarta Net Via Bazzanese 69
40033 Casalecchio di Reno
Bologna - Italy
Ph  +39051591054
fax +390516131537
web:www.sferacarta.com

Le informazioni contenute nella presente mail ed in ogni eventuale file 
allegato sono riservate e, comunque, destinate esclusivamente alla persona o 
ente sopraindicati, ai sensi del decreto legislativo 30 giugno 2003, n. 196. La 
diffusione, distribuzione e/o copiatura della mail trasmessa, da parte di 
qualsiasi soggetto diverso dal destinatario, sono vietate. La correttezza, 
l’integrità e la sicurezza della presente mail non possono essere garantite. Se 
avete ricevuto questa mail per errore, Vi preghiamo di contattarci 
immediatamente e di eliminarla. Grazie.

This communication is intended only for use by the addressee, pursuant to 
legislative decree 30 June 2003, n. 196. It may contain confidential or 
privileged information. You should not copy or use it to disclose its contents 
to any other person. Transmission cannot be guaranteed to be error-free, 
complete and secure. If you are not the intended recipient and receive this 
communication unintentionally, please inform us immediately and then delete 
this message from your system. Thank you.

--
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.

Reply via email to