Stateless CAS - The supplied proxy callback url j_spring_cas_security_proxyreceptor' could not be authenticated

杀马特。学长 韩版系。学妹 提交于 2019-12-12 05:39:56

问题


I need to secure my RESTful stateless webservices with CAS and right now I'm trying to follow this Spring Stateless CAS demo but continuously getting a following error:

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.

when accessing https://localhost:8443/first-spring-cas/testProxy.do url

This is for example my appointmentServiceUrl - https://localhost:8443/first-spring-stateless/appointment.jsp?ticket=PT-110-a2a6eOE3lwImcwGpZ2Jp-cas.example.com

What can be a reason of that ?


回答1:


Solved by adding

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

to casFilter

This is casFilter in the 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>


来源:https://stackoverflow.com/questions/34256197/stateless-cas-the-supplied-proxy-callback-url-j-spring-cas-security-proxyrecep

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!