OpenLDAP connection

36 views
Skip to first unread message

Stefan Messmer

unread,
Oct 24, 2025, 3:49:22 AMOct 24
to py4web
Hello 
I have the following settings:
# enable LDAP
USE_LDAP = True
LDAP_SETTINGS = {
    "mode": "uid",  # Microsoft Active Directory
    "server": "####.######.###",  # FQDN or IP of one Domain Controller
    "base_dn": "ou=users,dc=######,dc=###",  # base dn, i.e. where the users are located
    'user_firstname_attrib':'givenName',
    'user_lastname_attrib':'sn',
    'user_mail_attrib':'mail',
    "tls":True,
    'manage_user':True,
}

The fields 'user_firstname_attrib', 'user_lastname_attrib' are retrieved correctly, but the field 'user_mail_attrib' is not correctly fetched. The content of th field "uid"@example.com will be returned and not the value that's stored in the directory. Any idea what's going wrong?

Many thanks 
Stefan

Nico Zanferrari

unread,
Oct 24, 2025, 4:44:30 AMOct 24
to Stefan Messmer, py4web
Please open an issue on https://github.com/web2py/py4web

I have some old backlog changes to test and apply for ad / ldap authentication ... I just need to find the time ;-)

Nico

--
You received this message because you are subscribed to the Google Groups "py4web" group.
To unsubscribe from this group and stop receiving emails from it, send an email to py4web+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/py4web/ee6afa9f-d682-4a2d-ae32-db974068fe16n%40googlegroups.com.

Nico Zanferrari

unread,
Oct 26, 2025, 4:57:26 PMOct 26
to Stefan Messmer, py4web
It seems it's already been reported: https://github.com/web2py/py4web/issues/982

Nico

Nico Zanferrari

unread,
Oct 31, 2025, 12:53:10 PM (13 days ago) Oct 31
to Stefan Messmer, py4web
I hope I've just fixed it, but only for Microsoft AD - see https://github.com/web2py/py4web/pull/1008

Can you kindly check if its logic works fine with OpenLdap, too?

Cheers,
Nico

Massimo DiPierro

unread,
Nov 6, 2025, 2:22:28 AM (8 days ago) Nov 6
to py4web
I merged your PR although I was unable to test it.
Reply all
Reply to author
Forward
0 new messages