I have used ldap_auth successfully by implementing the following in 
models/db.py:
............................................................
from gluon.contrib.login_methods.ldap_auth import ldap_auth 
...
db = DAL('mysql://mydb:mydb@localhost/password') 
...
# --- end of web2py scaffolding ---
...
auth.settings.login_methods.append(ldap_auth(mode='ad', 
server='dc1.mydomain.com',base_dn='ou=users,dc=mydomain,dc=com'))
auth.settings.login_methods.append(ldap_auth(mode='ad', 
server='dc1.mydomain.com',base_dn='ou=operators,dc=mydomain,dc=com'))
...
db2 = DAL('oracle://myextradb/account@password', migrate=False)
............................................................

I found that I had to make extra database definitions after the append 
statements or I received a segmentation fault.  

I suspect that you could add another append statement to add an additional 
domain controller but I haven't tested this.

Hopefully this helps you - Tom


On Friday, July 19, 2019 at 11:30:00 PM UTC-6, Davidiam wrote:
>
> Hello,
>
> I have read and implemented the recipe for Windows active directory ldap 
> integration with Web2Py (
> http://www.web2py.com/books/default/chapter/29/09/access-control) and for 
> the most part the documentation is clear except for the last bit where it 
> refers to : 
>
> from gluon.contrib.login_methods.ldap_auth import ldap_auth
> auth.settings.login_methods.append(ldap_auth(mode='ad',
>    server='my.domain.controller',
>    base_dn='ou=Users,dc=domain,dc=com'))
>
> For me there are 2 things that aren't clear here :
> 1) Where should this code be inserted ?  In the default.py controller or 
> in db.py or somewhere else ?
> 2) We have multiple domain controllers in our domain, do we need to supply 
> a specific server for the server parameter ?
>
> An example of implementing this with the welcome application would be 
> appreciated, specifying the file which was modified. 
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/62b48bac-e85d-4ce7-94c4-637dfcf41aa3%40googlegroups.com.

Reply via email to