带有安全性和CAS的Spring3

时间:2011-11-03 19:29:12

标签: spring-mvc spring-security cas

我正在尝试使用带有安全性和CAS的Spring3。我收到以下错误。

原因:找不到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>

1 个答案:

答案 0 :(得分:0)

我认为您为org.jasig.cas.client.validation.Cas20ServiceTicketValidator bean指定的URL不应该在结尾处有/ login。

这是一个古老的问题;如果你是如何解决错误的,请告诉我。

相关问题