3

に、埋め込みLDAPをで使用する方法。現在、私の構成は-

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:security="http://www.springframework.org/schema/security" 
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
      http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
      http://www.springframework.org/schema/security 
      http://www.springframework.org/schema/security/spring-security-3.0.xsd">
    <bean id="contextSource" class="org.springframework.ldap.core.support.LdapContextSource">
        <property name="url" value="${PROVIDER_URL}" />
        <property name="base" value="${Search_Base}" />
        <property name="userDn" value="${SECURITY_PRINCIPAL}" />
        <property name="password" value="${SECURITY_CREDENTIALS}" />
    </bean>
    <bean id="ldapTemplate" class="org.springframework.ldap.core.LdapTemplate">
        <constructor-arg ref="contextSource" />
    </bean>
</beans>

ContextSource値は、プロパティファイルで利用できます。今、私は組み込みLDAPを使用したい-

<security:ldap-server ldif="classpath:sample.ldif"  root="cn=mojo"/>

LdapContextSource値で指定するデフォルトのポートは何ですか。

4

2 に答える 2

6

組み込みLDAPサーバーのポートのデフォルトはです。33389関連するソースコードを参照してください。

于 2013-03-10T19:58:24.307 に答える
3

要素のport属性を使用してポートを選択できます。リファレンスマニュアルの名前空間の付録ldap-serverを参照してください。これにより、デフォルト値も得られます。

于 2013-03-10T21:23:00.960 に答える