Can not specify the search_scope and attributes
tessactankit opened this issue · 1 comments
Hi etianen
I was using this package but could sync get users from DTS_USERS group. I am using it with below configurations
LDAP_AUTH_SEARCH_BASE = "CN=DTS_USERS,OU=Security Group,OU=Example,DC=Example,DC=com"
LDAP_AUTH_OBJECT_CLASS = "group"
LDAP_AUTH_USER_FIELDS = {
"username": "sAMAccountName",
"first_name": "givenName",
"last_name": "sn",
"email": "mail",
}
Rest all is provided correctly.
My custom search is :
from django_python3_ldap.utils import format_search_filters
def custom_format_search_filters(ldap_fields):
search_filters = format_search_filters(ldap_fields)
search_filters.append("(memberOf=CN=DTS_USERS,OU=Security Group,OU=Example,DC=Example,DC=com)")
return search_filters
But I can get the results with ldap3 with below configurations
conn.search(search_base='CN=DTS_USERS,OU=Security Group,OU=Example,DC=Example,DC=com',search_filter='(objectClass=group)',search_scope='SUBTREE',attributes = ['member'])
Can you please tell me how can I specify > search_scope='SUBTREE',attributes = ['member']
The ldap query already uses a search scope of subtree and requests all attributes.
So I think you might have some other problem.