susundberg / django-auth-ldap-ad

Django authentication backend for LDAP with Active Directory
GNU General Public License v2.0
76 stars 27 forks source link

Lookup arbitrary user #3

Closed sstark closed 8 years ago

sstark commented 9 years ago

First, sorry for filing an issue for this, but I could not find another way of contacting you. I would like to add functionality to this module to be able to look up user information (first_name, email, etc.) for arbitrary users, not just the currently logged in user.

I think what needs to be done is implementing an LDAPSearch class. I would just like to know before I try to look into this: would you want something like this in such a lightweight module? And: What source should I be looking at for the official protocol for implementing such a search?

susundberg commented 9 years ago

Hi! My sorries for late response.

No not really, i think this project should stay as django - sasl-authentication backend.

The backend does search on the current user, and if you just want the same search with different user, check the current search:

ldap_result_id = connection.search( self.ldap_settings.SEARCH_DN , ldap.SCOPE_SUBTREE, self.ldap_settings.SEARCH_FILTER % { "user" : username })
 result_all_type, result_all_data = connection.result(ldap_result_id, 1)

For more resourses, i suggest you to dig into the main python ldap-module documentation (that are not too great, unfortunately): http://www.python-ldap.org/docs.shtml

I suggest you copy/paste/fork the code and use it as you see best fit.

susundberg commented 8 years ago

Closing as inactive