Spring3 具有安全性和 CAS
我正在尝试将 Spring3 与安全性和 CAS 结合使用。我收到以下错误。
原因:找不到 org.springframework.security.authentication.UsernamePasswordAuthenticationToken 的 AuthenticationProvider
有人可以告诉我为什么吗?下面是我的 xml 文件
<authentication-manager alias="authenticationManager">
<authentication-provider ref="casAuthenticationProvider" />
</authentication-manager>
<beans:bean id="serviceProperties"
class="org.springframework.security.cas.ServiceProperties">
<beans:property name="service"
value="http://localhost:8081/Spring3MVCandHibernate3/j_spring_cas_security_check" />
<beans:property name="sendRenew" value="false" />
</beans:bean>
<beans:bean id="casAuthenticationProvider"
class="org.springframework.security.cas.authentication.CasAuthenticationProvider">
<beans:property name="userDetailsService" ref="userService" />
<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="http://localhost:8080/cas-server-webapp-3.4.10/login" />
</beans:bean>
</beans:property>
<beans:property name="key"
value="an_id_for_this_auth_provider_only" />
</beans:bean>
<user-service id="userService">
<user name="joe" password="joe" authorities="ROLE_USER" />
</user-service>
I am trying to use Spring3 with Security and CAS. I am getting the following error.
Reason: No AuthenticationProvider found for org.springframework.security.authentication.UsernamePasswordAuthenticationToken
Can someone please tell me why? below is my xml file
<authentication-manager alias="authenticationManager">
<authentication-provider ref="casAuthenticationProvider" />
</authentication-manager>
<beans:bean id="serviceProperties"
class="org.springframework.security.cas.ServiceProperties">
<beans:property name="service"
value="http://localhost:8081/Spring3MVCandHibernate3/j_spring_cas_security_check" />
<beans:property name="sendRenew" value="false" />
</beans:bean>
<beans:bean id="casAuthenticationProvider"
class="org.springframework.security.cas.authentication.CasAuthenticationProvider">
<beans:property name="userDetailsService" ref="userService" />
<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="http://localhost:8080/cas-server-webapp-3.4.10/login" />
</beans:bean>
</beans:property>
<beans:property name="key"
value="an_id_for_this_auth_provider_only" />
</beans:bean>
<user-service id="userService">
<user name="joe" password="joe" authorities="ROLE_USER" />
</user-service>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您为 org.jasig.cas.client.validation.Cas20ServiceTicketValidator bean 指定的 URL 不应以 /login 结尾。
这是一个老问题;请告诉我您是否就是这样修复错误的。
I think the URL you have specified for org.jasig.cas.client.validation.Cas20ServiceTicketValidator bean should not have /login at end.
Its an old question; please let me know if that's how you fixed your error.