I think you can enforce that this way : auth.settings.login_methods = [ldap_auth(...)] as the only method...
For instance I have : auth.settings.login_methods = [auth, ldap_auth(...)] So it check the password first in web2py then in Active Directory... I guess by removing the auth ad an authentication method it will only allow authentication against the ldap/AD instance. Richard On Mon, Sep 25, 2017 at 12:41 PM, Francisco García Claramonte < fgclaramo...@gmail.com> wrote: > Hello all, > > I am using logging methods: ldap_auth (in 'ad' mode) and auth. > My application logins perfectly from web auth form, validate with both > methods, depending the order of them. > > I am using AuthJWT for remote access, from an Android mobile application. > It works fine with local database. > My Web2py application validate users with jwt_token_manager() > This method calls to login_bare(username, password). > > According to source code: gluon/tools.py, 'login_bare' checks if user > exists in local database, if not, check the following login methods. > It doesn't work for me. > This is my situation with AuthJWT: > > 1- I user exists in local database, it is authenticated properly. > 2- If user doesn't exist in database, or auth fails, It doesn't try to > validate with ldap_auth method. > > I need that user always validate with ldap_auth. > > Do you know what is happening?. > Thank you in advance. > > Best regards, > Francisco. > > -- > 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. > -- 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.