I am also trying to authenticate against a LDAP server (not working).
I cannot get the ldapwhoami command to work, but ldap search does work
for me.  I do not think the server can respond to the command.
ldapsearch does work:

ldapsearch -b 'ou=yp,o=company.com' -H ldaps://yp.company.com -x
'mail=testu...@us.company.com'

I tried the ldap module directly, and that worked as well.
=================================
>>> import ldap
>>> dap = ldap.initialize('ldap://yp.company.com')
>>> dn=""
>>> pw=""
>>> dap.simple_bind_s(dn, pw)
(97, [])
>>> dap.search_s('ou=yp,o=company.com', 
>>> ldap.SCOPE_SUBTREE,'(mail=testu...@us.company.com)',['emailaddress','cn'])
[('uid=testUser,c=us,ou=yp,o=company.com', {'emailaddress':
['testu...@us.company.com'], 'cn': ['Test User']})]
>>>

==================================

my auth congids are as follows:

==================================
authDB = SQLDB('sqlite://auth_database.sqlite')

from gluon.tools import Auth, Mail
from gluon.contrib.login_methods.ldap_auth import ldap_auth

mail=Mail()
mail.settings.server='localhost:25'
mail.settings.sender='testu...@us.company.com'


auth=Auth(globals(),authDB)
auth.settings.login_methods.append(ldap_auth(mode='mail',
    server='yp.company.com',
    base_dn='ou=yp,o=company.com'
    ))
auth.define_tables()
auth.settings.mailer = mail
================================

I have PostgreSQL authenticating via pam_ldap using the same settings
that i have applied to the auth module.  What am I missing?  Is there
some other option that i need to pass to ldap_auth to get it to use
simple binding?




On Aug 4, 5:25 am, Johann Spies <johann.sp...@gmail.com> wrote:
> Apologies. I was testing from two different computers. On the one
> (where the web2py server was running) it was working and I did not see
> that the one from which I pasted the entries was failing. The
> following worked (same string with a 'TLS_REQCERT allow'  added to
> /etc/ldap/ldap.conf):
>
> $ ldapwhoami -H ldaps://stbldap01.sun.ac.za  -D
> 'cn=jspies,ou=users,O=SU' -x -v -W -n
> EnterLDAPPassword:
> ldap_initialize( ldaps://stbldap01.sun.ac.za:636/??base )
> Result: Success (0)
>
> Regards
> Johann
> 2009/8/4 Fran <francisb...@googlemail.com>:
>
>
>
> > We need a working string in order to know how to code that within
> > Web2Py.
> > All of these have failed...
>
> > F
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to