CAS中的多个AttributeRepository

时间:2016-03-16 13:18:13

标签: java spring ldap cas jasig

我正在使用CAS(JASIG)3.5.2服务器。我有两个LDAP服务器配置为 authenticationHandlers 进行身份验证。

现在,我需要在Validation Response中传递用户属性。我能够配置CAS以使用 attributeRepository bean从其中一个LDAP服务器返回用户属性。

我无法弄清楚我们如何配置CAS以从多个LDAP获取用户属性。

按照配置我试过了。

<bean id="attributeRepository" class="org.jasig.services.persondir.support.ldap.LdapPersonAttributeDao">
   <property name="contextSource" ref="openldap-contextSource" />
   <property name="requireAllQueryAttributes" value="true" />
   <property name="baseDN" value="dc=myorg,dc=com" />
   <property name="queryAttributeMapping">
      <map>
         <entry key="username" value="uid" />
      </map>
   </property>
   <property name="resultAttributeMapping">
      <map>
         <entry key="sn" value="lastName" />
         <entry key="givenName" value="firstName" />
         <entry key="mail" value="email" />
      </map>
   </property>
</bean>

如果我们希望单个LDAP获取用户,则此配置有效。如果我尝试重命名bean名称,它会在初始化时给出错误。

任何人都可以建议实现这个目标吗?

1 个答案:

答案 0 :(得分:1)

您需要定义两个属性存储库,合并它们并调用合并的存储库&#34; attributeRepository&#34;

https://github.com/Jasig/person-directory#mergingpersonattributedaoimpl