How to control LDAP Alias Dereferencing Mode using Java and Spring LDAP API? Similarly to how it is done using ldapsearch on linux.
Example:
ldapsearch -a ne开发者_开发知识库ver "(&(o=foo)(cn=bar))" cn
ldapsearch -a always "(&(o=foo)(cn=bar))" cn
I answer my own question.
The following does the job:
<bean id="ldapContextSource"
class="org.springframework.ldap.core.support.LdapContextSource"
p:url="${ldap.server.url}">
<property name="baseEnvironmentProperties">
<map>
<entry key="java.naming.ldap.derefAliases" value="never"/>
</map>
</property>
</bean>
精彩评论