Try replace

from gluon.contrib.login_methods.ldap_auth import ldap_auth
        auth.settings.login_methods.append(ldap_auth(
            mode='ad', server='dc01',
            base_dn='ou=Users,dc=domain,dc=com'))

with

from gluon.contrib.login_methods.ldap_auth import ldap_auth
        auth.settings.login_methods=[ldap_auth(
            mode='ad', server='dc01',
            base_dn='ou=Users,dc=domain,dc=com')]

 auth.settings.login_methods is a list of login methods and they are
executed in order. If you append to the defaul, you will still be
authenticated by the db if valid.

On May 4, 9:07 am, Sverre <[email protected]> wrote:
> I tried
>
> ----------------------------------------------------------
> from gluon.tools import *
> auth=Auth(globals(),db)              # authentication/authorization
>
> from gluon.contrib.login_methods.ldap_auth import ldap_auth
>         auth.settings.login_methods.append(ldap_auth(
>             mode='ad', server='dc01',
>             base_dn='ou=Users,dc=domain,dc=com'))
>
> ----------------------------------------------------------
>
> but the user data is taken from the user table in my database. What is
> wrong?
>
> Btw. thanks for the great community here.

Reply via email to