Re: [web2py] authenticate against Active Directory - need some direction.

2011-02-11 Thread Panupat Chongstitwattana
using direct ldap class I am able to log in using the following settings

login = 'n...@domain.com'
PWD = 'password'
server = 'ldap://localhost'

l = ldap.initialize(server)
l.set_option(ldap.OPT_REFERRALS, 0)
l.protocol_version = 3
l.simple_bind_s(login, PWD):

I really can't get it working with web2py DAL. How can I check if it
is communicating with the active directory or not?

from gluon.tools import Auth
auth = Auth(globals(), db)
auth.define_tables(username=True)
from gluon.contrib.login_methods.ldap_auth import ldap_auth
auth.settings.login_methods = [ldap_auth(mode='ad',
   server='localhost',
   base_dn='dc=domain,dc=com')]


[web2py] authenticate against Active Directory - need some direction.

2011-02-10 Thread Panupat
Hi everyone.

In my application I need to authenticate users against windows active
directory using user name and password. The user's group is also
determined by the active directory group.

So far I was able to do so using a the ldap class directory and use
lsearch to compare the group.

Can the same be archive using web2py DAL? I'm sad to say that I have
absolutely no clue what to do with the 4 lines of the example codes
showed in the online book >.>