Spring 安全注销成功 url 到另一台主机

Spring Security logout success url to another host

是否可以使 Spring Security 3.2.7.RELEASE 在注销后将用户重定向到另一台主机?我不能强迫它使用另一个主机。我正在使用某种 SSO 访问系统,这可能是个问题。

示例: 我的应用程序启动于 http://myAppUrl:8080/webapp1/
用户通过 http://ssoAccess:80/webapp1/ 访问它并导致真正的 url,但在浏览器中我仍然看到 ssoAccess url 一直(就像某种代理)

我想从 http://myAppUrl:8080/webapp1/logout.xhtml
制作注销按钮 注销然后重定向到 http://ssoAccess:80/appList

当 logout-success-url 设置为“http://ssoAccess:80/appList”时,它会重定向到 http://ssoAccess:80/webapp1/http://ssoAccess:80/appList 这显然是不正确的 url 返回 404.

我也尝试了 logout-success-handler,但仍然是同样的问题。我还尝试使 @Controller 在注销成功-url 指向的端点上具有返回 "redirect:http://ssoAccess:80/appList" 的方法。仍然没有运气。

我也在使用 JSF。

请帮忙!

一个简单的技巧是在 webapp1 中创建一个重定向到 appList 的 logout.xhtml 页面。

logout.xhtml:

<script language="javascript">
    window.location.href = "http://ssoAccess:80/appList"
</script>