【问题标题】:CAS - BACK_CHANNEL messaging not workingCAS - BACK_CHANNEL 消息不起作用
【发布时间】:2017-02-04 07:39:21
【问题描述】:

我使用的是 CAS 4.2.3。我有 2 个 cassified 弹簧安全应用程序。当我从 1 个应用程序中单次注销时,它不会注销其他应用程序。根据文档,BACK_CHANNEL 应该向所有注册的应用程序发布一条消息。

但是,就我而言,我在其他应用程序中没有看到来自 CAS 的任何消息。

我在 CAS 日志中也没有看到任何错误消息。

有人可以提供指导如何更好地调试此问题以解决此问题。

我在 cas.properties

中启用了以下功能
##
# Single Logout Out Callbacks
#
# To turn off all back channel SLO requests set this to true
slo.callbacks.disabled=false
#
# To send callbacks to endpoints synchronously, set this to false
slo.callbacks.asynchronous=true

在我的 cas 客户端 spring.xml 中添加以下内容,

<sec:http use-expressions="true" entry-point-ref="casEntryPoint">
    <sec:intercept-url pattern="/login/*" access="permitAll()" />
    <sec:intercept-url pattern="/lib/**" access="permitAll()" />
    <sec:intercept-url pattern="/**" access="hasRole('ROLE_ADMINISTRATOR')" />
    <sec:custom-filter ref="requestSingleLogoutFilter" before="LOGOUT_FILTER" />
    <sec:custom-filter ref="singleLogoutFilter" before="CAS_FILTER" />
    <sec:custom-filter position="CAS_FILTER" ref="casFilter" />
    <sec:logout logout-success-url="/logout.jsp?service=https://<hostname>/WebApp4/j_spring_cas_security_check" />
</sec:http>

<!-- This filter handles a Single Logout Request from the CAS Server -->
<bean id="singleLogoutFilter" class="org.jasig.cas.client.session.SingleSignOutFilter">
    <property name="artifactParameterName" value="SAMLart"></property>
</bean>

<!-- This filter redirects to the CAS Server to signal Single Logout should be performed -->
<bean id="requestSingleLogoutFilter" class="org.springframework.security.web.authentication.logout.LogoutFilter">
    <constructor-arg value="https://<hostname>/cas/logout" />
    <constructor-arg>
        <bean class="org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler" />
    </constructor-arg>
    <property name="filterProcessesUrl" value="/logout/cas" />
</bean>

并在web.xml中添加以下内容,

<listener>
    <listener-class>org.jasig.cas.client.session.SingleSignOutHttpSessionListener</listener-class>
</listener>

【问题讨论】:

    标签: java spring-security cas


    【解决方案1】:

    您需要确保在您的配置中启用了 SLO,并且您的应用程序必须准备好捕获该 POST 并将用户注销。

    【讨论】:

    • 能否请您帮我详细说明如何启用 SLO。它是否需要在 cas.properties 中打开?我将 SingleSingoutFilter 和侦听器添加到 cas 客户端。为了准备捕获 POST 请求并处理它,我是否需要从 cas 客户端执行任何其他操作。首先,当我执行 /cas/logout
    • 我用我用来启用 SLO 的代码更新了描述。
    • 我不知道 Spring Security 是如何工作的。要进行故障排除,您需要将 CAS 日志更新为 DEBUG 并查看会发生什么。如果你看到消息出去了,那么剩下的就在 SS 上。
    • 其实我已经启用了TRACE登录。我没有看到任何错误消息。我终于能够通过使用 FRONT_CHANNEL 使其工作。虽然,我希望它与 BACK_CHANNEL 一起使用。
    • 此链接中提供日志,click here
    猜你喜欢
    • 2019-01-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-01-07
    • 2017-06-10
    • 1970-01-01
    • 1970-01-01
    • 2013-07-24
    相关资源
    最近更新 更多