forgot to tell for *email_auth *expected result: can not login because not sure have smtp.one.com:587 and the domain name in configuration is one.com but the tested login using b.com
best regards, stifan On Friday, June 15, 2018 at 5:41:57 AM UTC+7, 黄祥 wrote: > > test another login method seems not work too, step i took > 1. create new web2py app > 2. use code from book and use it on models/db.py > *ref:* > > http://web2py.com/books/default/chapter/29/09/access-control#Other-login-methods-and-login-forms > 3. test with wrong username, email or password > > *basic_auth* > 2. models/db.py > from gluon.contrib.login_methods.basic_auth import basic_auth > auth.settings.login_methods.append( > basic_auth('https://one.one.com')) > auth.settings.login_methods = [basic_auth] > > 3. open http://localhost:8000/test/default/user/login > email: [email protected] > password: a > 4. result: > Traceback (most recent call last): > File "/Users/sugizo/web2py/gluon/restricted.py", line 219, in restricted > exec(ccode, environment) > File "/Users/sugizo/web2py/applications/test/controllers/default.py", > line 60, in <module> > File "/Users/sugizo/web2py/gluon/globals.py", line 419, in <lambda> > self._caller = lambda f: f() > File "/Users/sugizo/web2py/applications/test/controllers/default.py", > line 49, in user > return dict(form=auth()) > File "/Users/sugizo/web2py/gluon/tools.py", line 1925, in __call__ > return getattr(self, args[0])() > File "/Users/sugizo/web2py/gluon/tools.py", line 2745, in login > request.vars[passfield]): > TypeError: basic_auth() takes at most 1 argument (2 given) > > > *email_auth* > 2. models/db.py > from gluon.contrib.login_methods.email_auth import email_auth > auth.settings.login_methods.append( > email_auth("smtp.one.com:587", "@one.com")) > auth.settings.login_methods = [email_auth] > > 3. open http://localhost:8000/test/default/user/login > email: [email protected] > password: b > 4. result: can logged in > > *pam_auth* > 2. models/db.py > auth.define_tables(username=True, signature=False) > from gluon.contrib.login_methods.pam_auth import pam_auth > auth.settings.login_methods.append(pam_auth()) > auth.settings.login_methods = [pam_auth] > > 3. open http://localhost:8000/test/default/user/login > username: b > password: b > 4. result: > Traceback (most recent call last): > File "/Users/sugizo/web2py/gluon/restricted.py", line 219, in restricted > exec(ccode, environment) > File "/Users/sugizo/web2py/applications/test/controllers/default.py", > line 60, in <module> > File "/Users/sugizo/web2py/gluon/globals.py", line 419, in <lambda> > self._caller = lambda f: f() > File "/Users/sugizo/web2py/applications/test/controllers/default.py", > line 49, in user > return dict(form=auth()) > File "/Users/sugizo/web2py/gluon/tools.py", line 1925, in __call__ > return getattr(self, args[0])() > File "/Users/sugizo/web2py/gluon/tools.py", line 2745, in login > request.vars[passfield]): > TypeError: pam_auth() takes no arguments (2 given) > > > *gae_google_login* > 2. models/db.py > from gluon.contrib.login_methods.gae_google_login import GaeGoogleAccount > auth.settings.login_form = GaeGoogleAccount() > auth.settings.login_methods = [GaeGoogleAccount] > > 3. open http://localhost:8000/test/default/user/login > 4. result: > Traceback (most recent call last): > File "/Users/sugizo/web2py/gluon/restricted.py", line 219, in restricted > exec(ccode, environment) > File "/Users/sugizo/web2py/applications/test/models/db.py", line 156, in > <module> > from gluon.contrib.login_methods.gae_google_login import > GaeGoogleAccount > File "/Users/sugizo/web2py/gluon/custom_import.py", line 111, in > custom_importer > return NATIVE_IMPORTER(name, globals, locals, fromlist, level) > ImportError: No module named gae_google_login > > > not tested another, because not installed python module yet (OpenID, > OAuth2.0, LinkedIn, X509) > for ldap already tested in another thread > *ref:* > https://groups.google.com/forum/#!topic/web2py/7jbLlV_n1-Y > > any idea? > > thx n best regards, > stifan > -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.

