【问题标题】:Spring3 with Security and CAS具有安全性和 CAS 的 Spring3
【发布时间】:2012-07-21 03:20:51
【问题描述】:

我正在尝试将 Spring3 与 Security 和 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>

【问题讨论】:

    标签: spring-mvc spring-security cas


    【解决方案1】:

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

    这是一个老问题;请让我知道您是否这样修复了错误。

    【讨论】:

      猜你喜欢
      • 2014-09-11
      • 1970-01-01
      • 2015-12-06
      • 2018-06-17
      • 1970-01-01
      • 2016-03-22
      • 2017-11-03
      • 2023-03-26
      • 1970-01-01
      相关资源
      最近更新 更多