Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/343.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何将旧代码从SpringSecurity2.0迁移到3.0;s基于ConcurrentSessionControllerImpl?_Java_Spring_Spring Security_Migration - Fatal编程技术网

Java 如何将旧代码从SpringSecurity2.0迁移到3.0;s基于ConcurrentSessionControllerImpl?

Java 如何将旧代码从SpringSecurity2.0迁移到3.0;s基于ConcurrentSessionControllerImpl?,java,spring,spring-security,migration,Java,Spring,Spring Security,Migration,我现在坐在一个使用SpringSecurity2.0的旧Java代码上,它必须迁移到SpringSecurity3.0及更高版本 我现在的问题是,有一个类扩展了ConcurrentSessionControlImpl,该类已在SpringSecurity3.0中通过重构删除。关键是我找不到任何关于此重构的文档,也找不到任何关于SpringSecurity2.0文档中的ConcurrentSessionControlleImpl类的文档 该类覆盖以下方法: public void checkAut

我现在坐在一个使用SpringSecurity2.0的旧Java代码上,它必须迁移到SpringSecurity3.0及更高版本

我现在的问题是,有一个类扩展了
ConcurrentSessionControlImpl
,该类已在SpringSecurity3.0中通过重构删除。关键是我找不到任何关于此重构的文档,也找不到任何关于SpringSecurity2.0文档中的
ConcurrentSessionControlleImpl
类的文档

该类覆盖以下方法:

public void checkAuthenticationAllowed(final Authentication auth) throws AuthenticationException;

public void registerSuccessfulAuthentication(final Authentication authentication);

有迁移的方法吗,或者我必须重写整个应用程序安全层吗?

由于Spring security的重构,
ConcurrentSessionControlImpl
大部分被重构为
org.springframework.security.web.authentication.session.ConcurrentSessionControlStrategy

其中
registerSuccessfulAuthentication
最佳映射到

onAuthentication(Authentication authentication, HttpServletRequest request, HttpServletResponse response)
checkauthenticationlowed
现在是
ConcurrentSessionControlStrategy
中的私有方法,可以通过以下方式进行部分自定义:

protected void allowableSessionsExceeded(List<SessionInformation> sessions, int allowableSessions, SessionRegistry registry);

protected int getMaximumSessionsForThisUser(Authentication authentication);

有关
ConcurrentSessionControlStrategy
的更多信息,请查看。

以及Spring Security 2.0文档中的ConcurrentSessionControlImpl类。真正地Google关于*ConcurrentSessionControllerImpl*的第一个链接很抱歉,当谈到文档时,我指的是这种文档:所以对我来说,这个类看起来像是Spring内部的一个,不应该被触碰?
public void setExceptionIfMaximumExceeded(boolean exceptionIfMaximumExceeded);
public void setMaximumSessions(int maximumSessions);