开发者

Dereferencing Aliases in LDAP using Spring

开发者 https://www.devze.com 2022-12-09 15:16 出处:网络
How to control LDAP Alias Dereferencing Mode using Java and Spring LDAP API? Similarly to how it is done using ldapsearch on linux.

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

精彩评论

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