On May 4, 9:22 am, mdipierro <[email protected]> wrote:
> 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')]

... or perhaps:  auth.settings.login_methods.insert(0,
ldap_auth(...) )
>
>  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.

... so you want to be intentional about the authentication services,
and  order  you want to implement.
>
> 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