【问题标题】:Stateless CAS - The supplied proxy callback url j_spring_cas_security_proxyreceptor' could not be authenticated无状态 CAS - 提供的代理回调 url j_spring_cas_security_proxyreceptor' 无法通过身份验证
【发布时间】:2015-12-13 20:52:44
【问题描述】:

我需要使用 CAS 保护我的 RESTful 无状态 Web 服务,现在我正在尝试关注这个 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 url时

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

这可能是什么原因?

【问题讨论】:

    标签: spring cas jasig


    【解决方案1】:

    添加解决

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

    casFilter

    这是applicationContext-security.xml中的casFilter

     <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>
    

    【讨论】:

    • 你能告诉我casFilter到底是​​什么吗?
    • @AnujKu 我已经用 casFilter 声明更新了我的答案。老实说,我不记得关于这个主题的太多细节,因为那是几年前的事了。无论如何,希望对您有所帮助。
    • @alexanoid 感谢您的快速更新。只是一个简单的问题,如果你还记得 j_spring_cas_security_proxyreceptor 端点是 spring 默认给你的东西吗?
    • 我可能是错的,但 AFAIK 这是你应该在与 CAS 连接的应用程序的 Spring CAS Security 内获得的东西。例如,您可以在 proxyCallbackUrl - docs.spring.io/spring-security/site/docs/3.1.x/reference/… 找到版本 3.1.x 的 /j_spring_cas_security_proxyreceptor 配置的提及。对于当前版本,网址略有不同 docs.spring.io/spring-security/site/docs/current/reference/html/… - &lt;property name="proxyCallbackUrl" value="https://localhost:8443/cas-sample/login/cas/proxyreceptor"/&gt;
    猜你喜欢
    • 2015-07-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-11-12
    • 2022-08-19
    • 2018-02-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多