开发者

Dereferencing Aliases in LDAP using Spring

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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜