ldap search is very slow

前端 未结 3 1658
清酒与你
清酒与你 2020-12-20 00:45

I am using JNDI to connect to the LDAP active directory, and I want to search for users where the name contains the search string, so my search method is as follows:

相关标签:
3条回答
  • 2020-12-20 01:27

    You're right,

    ldapEnv.put(Context.REFERRAL, "ignore") 
    

    didn't get exception about connection timed out. But when I first try I get a partialexception. After I changed my LDAP configuration port from 389 to 3268 I didn't get any exception, build successfully. 3268 port about global catalog of LDAP. For example Outlook clients query the global catalog to locate Address Book information. You can try global catalog if you get an exception referral type setting.

    0 讨论(0)
  • 2020-12-20 01:34

    Solution was to change ldapEnv.put(Context.REFERRAL, "follow"); to ldapEnv.put(Context.REFERRAL, "ignore");

    0 讨论(0)
  • 2020-12-20 01:42

    Your filter:

    "(&(ObjectCategory=person)(cn=*" + name + "*))"
    

    May be an issue.

    I would recommend that you download a known LDAP utility (Apache Directory Studio Browser as an example) and try different search filters until you find one that works.

    To Start, try

    "(&(ObjectCategory=person)(cn= + name ))"
    
    0 讨论(0)
提交回复
热议问题