2010-09-22 35 views
0

春天有沒有什麼辦法可以設置它,以便當局可以在多個位置查找?春季ldap在權威人羣中的多個羣體基地

<bean id="authoritiesPopulator" class="org.springframework.security.ldap.populator.DefaultLdapAuthoritiesPopulator"> 
    <constructor-arg ref="contextSource" /> 
    <constructor-arg value="CN=Users" /> 
    <property name="groupRoleAttribute" value="CN" /> 
    <property name="searchSubtree" value="true" /> 
    <property name="rolePrefix" value="" /> 
    <property name="convertToUpperCase" value="false" /> 
</bean> 

這是一般的想法,但也有在CN = OtherGroups羣體,而現在他們沒有得到加載(明顯)。但是,將groupsearchbase(第二個構造函數arg)設置爲value =「」會導致錯誤:

未處理的繼續引用;剩餘的名字''

任何想法?

回答

0

答案:請參照下列設置。

<bean id="contextSource" class="org.springframework.security.ldap.DefaultSpringSecurityContextSource"> 
    .... 
    <property name="baseEnvironmentProperties"> 
     <map> 
      <entry key="java.naming.referral" value="follow" /> 
     </map> 
    </property> 
</bean>