【发布时间】:2013-12-14 15:08:52
【问题描述】:
我现在在将 CAS 与 LDAP 结合使用时遇到了一些问题。我想为多个应用程序实施 SSO 解决方案。到目前为止,身份验证效果很好。我们希望根据用户在 LDAP 中配置的角色来授权用户。问题是 CAS 不提供用户角色。
到目前为止,我知道deployerConfigContext.xml 需要配置。我还找到了各种教程,大多数都使用了错误版本的 CAS,或者没有按照我的意愿去做。
我们的用户位于cn=admin,cn=users,dc=manager,dc=local,群组位于cn=admins,ou=groups,dc=manager,dc=local。 CAS版本是3.5.2
我尝试过像这样插入:
<bean id="attributeRepository" class="org.jasig.services.persondir.support.StubPersonAttributeDao">
<property name="backingMap">
<map>
<entry key="uid" value="uid" />
<entry key="eduPersonAffiliation" value="eduPersonAffiliation" />
<entry key="groupMembership" value="groupMembership" />
</map>
</property>
<property name="query" value="(uid={0})" />
<property name="contextSource" ref="contextSource" />
<property name="ldapAttributesToPortalAttributes">
<map>
<entry key="cn" value="Name" />
<entry key="home" value="homeDirectory" />
</map>
</property>
</bean>
CAS 告诉我他不喜欢 query、contextSource 和 ldapAttributesToPortalAttributes 的属性。我想获取“简单”属性 homeDirectory。
你们中的任何人都可以给我一些关于如何配置那个邪恶的 xml 文件的提示吗?如果你愿意,我也可以提供完整的 xml 文件。
更新
经过一番摆弄,我尝试在此站点上配置attributeRepository:https://wiki.jasig.org/display/CASUM/Attributes 在章节Populate Principal's attributes with LDAP repository 中。结果是 CAS 没有启动,而是给了我消息
Bean property 'ldapAttributesToPortalAttributes' is not writable or has an invalid setter method.
我的attributeRepository 看起来像这样:
<bean id="attributeRepository" class="org.jasig.services.persondir.support.ldap.LdapPersonAttributeDao">
<property name="ldapAttributesToPortalAttributes">
<map>
<entry key="cn" value="Name" />
<entry key="home" value="homeDirectory" />
</map>
</property>
</bean>
【问题讨论】:
标签: ldap single-sign-on cas ldap-client