作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 CAS (JASIG) 3.5.2 服务器。我有两个 LDAP 服务器配置为身份验证作为 authenticationHandlers。
现在,我需要在验证响应中传递用户属性。我可以将 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 名称,则会在初始化时出现错误。
有人可以提出实现这一目标的方法吗?
最佳答案
您需要定义两个属性存储库,将它们合并并将合并后的属性存储库称为“attributeRepository”
https://github.com/Jasig/person-directory#mergingpersonattributedaoimpl
关于java - CAS中的多个AttributeRepository,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36036856/
我是一名优秀的程序员,十分优秀!