Are you planning to actually use any of these methods? If so, I would 
suggest setting them up properly with real authentication services, and 
only then report back if you are receiving errors. They are not necessarily 
supposed to work as expected with dummy inputs.

Anthony

On Thursday, June 14, 2018 at 8:24:04 PM UTC-4, 黄祥 wrote:
>
> thanks for the detail explaination, Anthony.
>
> moral of tested other login method:
> either use auth.settings.login_methods.append(your_choosen_login_method() )
> or use auth.settings.login_methods = [your_choosen_login_method() ] # this 
> one to eliminate the default auth method
>
> tested work : pam()
> not tested : basic_auth() because dont have an authentication service
> tools for tested basic_auth : curl or postman, not sure can tested using 
> web2py cas_provider
> *ref:*
>
> http://www.web2pyslices.com/slice/show/1877/single-login-by-two-different-ways
>
> still not work
> *email_auth*
> 2 models/db.py
> from gluon.contrib.login_methods.email_auth import email_auth
> auth.settings.login_methods.append(
>     email_auth("mail.domain.com:25", "@domain.com"))
>
> 3 open http://localhost:8000/test/default/user/login
> input correct email and password
> 4 result: 
> on browser:
> Invalid Login 
> on terminal that start web2py (python web2py.py):
> ERROR:root:email_auth() failed
> Traceback (most recent call last):
>   File "/Users/sugizo/web2py/gluon/contrib/login_methods/email_auth.py", 
> line 30, in email_auth_aux
>     server = smtplib.SMTP(host, port)
>   File 
> "/Users/MacBookPro/miniconda3/envs/python2_prod/lib/python2.7/smtplib.py", 
> line 256, in __init__
>     (code, msg) = self.connect(host, port)
>   File 
> "/Users/MacBookPro/miniconda3/envs/python2_prod/lib/python2.7/smtplib.py", 
> line 317, in connect
>     self.sock = self._get_socket(host, port, self.timeout)
>   File 
> "/Users/MacBookPro/miniconda3/envs/python2_prod/lib/python2.7/smtplib.py", 
> line 292, in _get_socket
>     return socket.create_connection((host, port), timeout)
>   File 
> "/Users/MacBookPro/miniconda3/envs/python2_prod/lib/python2.7/socket.py", 
> line 575, in create_connection
>     raise err
> error: [Errno 65] No route to host
>
> 5. tested login to webmail can login : domain.com/webmail
>
> *ldap_auth (start ldap server : *./apacheds.sh run*)*
> 2 models/db.py
> auth.define_tables(username=True, signature=False)
> from gluon.contrib.login_methods.ldap_auth import ldap_auth
> """
> auth.settings.login_methods.append(ldap_auth(mode = '1', 
>                                              server = '1',
>                                              port = 1, 
>                                              base_dn = 'ou=1,dc=1,dc=1') )
> """
> # use this to ensure only using sole [ldap_auth() ] not [auth and 
> ldap_auth() ]
> auth.settings.login_methods = [
> ldap_auth(mode = '1', server = '1', port = 1, base_dn = 'ou=1,dc=1,dc=1') 
> ]
>
> 3 open http://localhost:8000/test/default/user/login
> input incorrect username and password
> 4 result: 
> can login
> 5 expected result:
> cannot login
>
> *gae_google_account*
> 2 models/db.py
> from gluon.contrib.login_methods.gae_google_account import 
> GaeGoogleAccount
> auth.settings.login_form = 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_account import 
> GaeGoogleAccount
>   File "/Users/sugizo/web2py/gluon/custom_import.py", line 111, in 
> custom_importer
>     return NATIVE_IMPORTER(name, globals, locals, fromlist, level)
>   File 
> "/Users/sugizo/web2py/gluon/contrib/login_methods/gae_google_account.py", 
> line 12, in <module>
>     from google.appengine.api import users
>   File "/Users/sugizo/web2py/gluon/custom_import.py", line 104, in 
> custom_importer
>     raise ImportError(e1, import_tb)  # there an import error in the 
> module
> ImportError: (ImportError('No module named google.appengine.api',), 
> <traceback 
> object at 0x1072f6368>)
>
> 5 seems must installed python module
>
> any hints?
>
> 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.

Reply via email to