无状态CAS - 提供的代理回调url j_spring_cas_security_proxyreceptor'无法通过身份验证

时间:2015-12-13 20:52:45

标签: spring cas jasig

我需要使用CAS来保护我的RESTful无状态网络服务,现在我正在尝试关注此Spring Stateless CAS演示,但不断收到以下错误:

22:42:27.885 [http-nio-8443-exec-8] [first-spring-stateless] DEBUG o.s.s.c.web.CasAuthenticationFilter - Authentication request failed: org.springframework.security.authentication.BadCredentialsException: 
            The supplied proxy callback url 'https://localhost:8443/first-spring-stateless/j_spring_cas_security_proxyreceptor' could not be authenticated.
访问https://localhost:8443/first-spring-cas/testProxy.do网址时

这是我的appointmentServiceUrl - https://localhost:8443/first-spring-stateless/appointment.jsp?ticket=PT-110-a2a6eOE3lwImcwGpZ2Jp-cas.example.com

enter image description here

这可能是什么原因?

1 个答案:

答案 0 :(得分:1)

添加

解决
<property name="proxyReceptorUrl"               value="/j_spring_cas_security_proxyreceptor"/>

casFilter

这是casFilter中的applicationContext-security.xml

 <bean id="casFilter"
        class="org.springframework.security.cas.web.CasAuthenticationFilter">
    <property name="authenticationManager"          ref="authenticationManager"/>
    <property name="proxyGrantingTicketStorage"     ref="pgtStorage"/>
    <property name="serviceProperties"              ref="serviceProperties"/>

    <property name="proxyReceptorUrl"               value="/j_spring_cas_security_proxyreceptor"/>
    <property name="authenticationDetailsSource">
      <bean class="org.springframework.security.cas.web.authentication.ServiceAuthenticationDetailsSource"/>
    </property>
  </bean>