ConcurrentSessionControlStrategy와 내 sessionRegistry 구현으로 작동하는 구성이있었습니다. 스프링 보안 3.2.4로 업그레이드하여 ConcurrentSessionControlStrategy를 ConcurrentSessionControlAuthenticationStrategy로 변경해야했습니다. 이제는 sessionRegistry가 연결되지 않은 것으로 보입니다. ConcurrentSessionControlAuthenticationStrategy.onAuthenticaton이 sessionRegistry.registerNewSession을 입력하지 않는다는 의미입니다. 뭐라구? ConcurrentSessionControlStrategy in spring security 3.2.4
내 구성 XML :<security:http use-expressions="true" auto-config="false"
entry-point-ref="loginUrlAuthenticationEntryPoint">
<security:intercept-url pattern="/**"
access="isAuthenticated()" />
<security:custom-filter position="FORM_LOGIN_FILTER"
ref="twoFactorAuthenticationFilter" />
<security:logout logout-url="/player/logout"
logout-success-url="/demo/player/logoutSuccess" />
<security:session-management>
<security:concurrency-control
max-sessions="1" session-registry-ref="clusteredSessionRegistryImpl"
error-if-maximum-exceeded="false" />
</security:session-management>
</security:http>
<bean
class="org.springframework.security.web.authentication.session.ConcurrentSessionControlAuthenticationStrategy">
<constructor-arg ref="clusteredSessionRegistryImpl" />
<property name="maximumSessions" value="1" />
</bean>
<bean id="loginUrlAuthenticationEntryPoint"
class="org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint">
<property name="loginFormUrl" value="/demo/player/login?login_error=true" />
</bean>
<bean id="twoFactorAuthenticationFilter" class="com.XXX.filter.TwoFactorAuthenticationFilter">
<property name="authenticationManager" ref="authenticationManager" />
<property name="authenticationFailureHandler" ref="failureHandler" />
<property name="authenticationSuccessHandler" ref="playerAuthenticationSuccessHandler" />
<property name="postOnly" value="true" />
</bean>
<bean id="failureHandler"
class="org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler">
<property name="defaultFailureUrl" value="/login?login_error=true" />
</bean>
<bean id="bCryptPasswordEncoder"
class="org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder" />
<security:authentication-manager alias="authenticationManager">
<security:authentication-provider
ref="authenticationProvider">
</security:authentication-provider>
</security:authentication-manager>
</beans>
'ConcurrentSessionControlAuthenticationStrategy'에 대한 정의는 아무 것도하지 않거나 추가하지 않으며, 네임 스페이스에 의해 구성됩니다. –
잘 모르겠습니다. 내 XML은 내 세션 레지스트리 구현을 넣는다. onAuthentication을 호출하면 세션 레지스트리에 들어 가지 않는다. – lior
'ConcurrentSessionControlAuthenticationStrategy' 빈 정의가 중복되었습니다. 이것은' '에 의해 수행되므로 제거 할 수 있습니다. 또한 적절한 구성이 손상 될 수 있습니다 (재정의하려는 것을 무시). 요점은 모든 것이 이전의 버전에서 모든 것이 ConcurrentSessionControlStrategy 내부에서 수행되었지만 이제는 여러 클래스로 위임되는 반면, 모든 것이 분리되어 있다는 것입니다. 그러나 리던던트 빈의 등록은 아마도 기본 설정을 깨고'RegisterSessionAuthenticationStrategy'를 등록하지 않을 것입니다. –