在另一个线程调用RMI之后,HttpSession被清除

时间:2017-09-06 09:24:42

标签: java spring spring-security rmi

我的应用程序使用Spring Security(4.2.1.RELEASE),我遇到一个请求有问题,在该请求期间我的应用程序使用RMI调用其他应用程序(使用Spring' s RmiProxyFactoryBean)。在该调用期间,我可以在日志中看到,RMI线程没有关于SecurityContext的信息并清除当前HttpSession

SecurityContextPersistenceFilter调用HttpSessionSecurityContextRepository.saveContext

时会发生这种情况
[2017-09-05T17:24:32,759] [RMI TCP Connection(4)-10.200.61.22] [DEBUG][HttpSessionSecurityContextRepository$SaveToSessionResponseWrapper] - SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession.

此后,用户不再进行身份验证。

如何克服这个?我应该以某种方式将SecurityContext附加到RMI线程吗?或者(更简单的方法?)从安全链中排除RMI呼叫(RMI呼叫没有任何身份验证)。 为什么RMI的电话会通过网络传播?安全过滤链?

以前,WebApp使用Spring Security 3.0.5,升级到新版本后出现问题。

0 个答案:

没有答案