Java 如何将旧代码从SpringSecurity2.0迁移到3.0;s基于ConcurrentSessionControllerImpl?
我现在坐在一个使用SpringSecurity2.0的旧Java代码上,它必须迁移到SpringSecurity3.0及更高版本 我现在的问题是,有一个类扩展了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
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);