Hi, I am trying to include ldap authentication to my app, and for this, i am using this code:

auth.settings.login_methods.append(ldap_auth(
    mode='uid',
    server='10.6.xx.xx',
    base_dn='dc=comp',
    filterstr='&(objectClass=inetOrgPerson)',
    logging_level='debug'))

(note: The Original server and base_dn values are changed in this example. I also have tried with and without the filterstr option)

But I can't login with any ldap user, and the logs only say:

DEBUG:web2py.auth.ldap_auth:mode: [uid] manage_user: [False] custom_scope: [subtree] manage_groups: [False]
INFO:web2py.auth.ldap_auth:[10.6.28.93] Initialize ldap connection

I Debug the ladp_auth module, and for some reason it hangs on the line 314 ( con.simple_bind_s(dn, password)) without throw any error.

If it helps, I also have tried this code and works as expected returning the ldap user data:

import ldap
ldap_server="10.6.xx.xx"
username = "auser"
base_dn = "dc=comp"

query = "(uid=%s)" % username
con = ldap.initialize('ldap://'+ldap_server)

result = con.search_s(base_dn, ldap.SCOPE_SUBTREE, query)
print result


Any help or idea?

Greetings.


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to