我试图解决一个问题,使用CAS与Spring安全,当我做一个链接到另一个URL使用相同的CAS服务器。CAS与SavedRequestAwareAuthenticationSuccessHandler没有正确重定向
我试图通过SavedRequestAwareAuthenticationSuccessHandler像这样link改变SimpleURLAuthenticationSuccess,但仍然无法正常工作。
为了更好地展示我的情况是:
我有同样的CAS服务器在运行两个应用程序。 当我访问应用程序1时,然后我去CAS服务器。 登录后,我可以正常访问应用程序的上下文。
,当我通过下面的链接
<a href="/applicationB/pages/motors/1"/>
我重定向到CAS和CAS重定向我/ applicationB,应用程序的情况下尝试访问应用2的问题发生。
与此link根据,我只是应该SavedRequestAwareAuthenticationSuccessHandler改变豆SimpleURLAuthenticationSuccess
编辑
我看到了,也许该解决方案是不使用SavedRequestAwareAuthenticationSuccessHandler,因为在CasAuthenticationFilter扩展AbstractAuthenticationProcessingFilter这个类有以下方法:
/**
* Sets the strategy used to handle a successful authentication.
* By default a {@link SavedRequestAwareAuthenticationSuccessHandler} is used.
*/
public void setAuthenticationSuccessHandler(AuthenticationSuccessHandler successHandler) {
Assert.notNull(successHandler, "successHandler cannot be null");
this.successHandler = successHandler;
}
解决!!!解决方案留在这里[链接](http://jlorenzen.blogspot.com.br/2013/07/remember-target-url-with-spring.html)。请尽可能在spring-security上提供这个问题,以帮助我们扩展CasAuthenticationProvider的功能,链接[link](https://jira.springsource.org/browse/SEC-2188) –