我目前已经配置并且成功运行了Spring Security。我想让CAS工作,以便我可以拥有跨多个应用程序的单点登录。但是我不知道如何使CAS使用我的自定义userdetailService。
目前,在我的spring-security.xml文件中,我有以下内容:
<authentication-manager alias="authManager">
<authentication-provider user-service-ref="userDetailsService">
<password-encoder ref="passwordEncoder">
<salt-source ref="saltSource"/>
</password-encoder>
</authentication-provider>
</authetication-manager>
我找到的所有cas示例都建议按照以下方式实现管理:
<beans:bean id="casAuthenticationProvider" class="org.springframework.security.cas.authentication.CasAuthenticationProvider">
<beans:property name="authenticationUserDetailsService">
<beans:bean class="org.springframework.security.core.userdetails.UserDetailsByNameServiceWrapper">
<beans:constructor-arg ref="userDetailsService"/>
</beans:bean>
</beans:property>
<beans:property name="serviceProperties" ref="serviceProperties"/>
<beans:property name="ticketValidator">
<beans:bean class="org.jasig.cas.client.validation.Cas20ServiceTicketValidator">
<beans:constructor-arg index="0" value="https://localhost:8443/cas"/>
</beans:bean>
</beans:property>
<beans:property name="key" value="1234554321"/>
</beans:bean>
<authentication-manager alias="authManager">
<authentication-provider ref="casAuthenticationProvider"/>
</authentication-manager>
文档有些混乱。我该如何从一个工作的spring-security应用程序转换到实现cas并仍然使用我的自定义用户详细信息?还需要更改jsp页面上的哪些内容?非常感谢您的帮助。
谢谢