Install python-ldap
1. Download and install python-ldap (e.g. python-ldap-2.4.3.win32-py2.7)
Edit models/db.py
2. edit auth.define_tables() to allow login with username and not email.
auth.define_tables(username=True)
auth.settings.create_user_groups=False
3. Add the following at the bottom of page.
Replace server and base_dn to your setting.
# all we need is login
auth.settings.actions_disabled=['register','change_password','request_reset_password','retrieve_username','profile']
# you don't have to remember me
auth.settings.remember_me_form = False
# ldap authentication and not save password on web2py
from gluon.contrib.login_methods.ldap_auth import ldap_auth
auth.settings.login_methods = [ldap_auth(mode='ad',
server='OchibaServer',
base_dn='dc=ochiba,dc=com')]




Comments (3)
0
lgwapnitsky 1 year ago
0
ochiba77 1 year ago
0
nickvargish 1 year ago