Maximum concurrent users in Spring Security

前端 未结 3 1345
有刺的猬
有刺的猬 2021-01-05 04:43

I am using Spring Security 3.0 in my project and I am restricting user to have maximum one session. Configuration is given below :



        
相关标签:
3条回答
  • 2021-01-05 05:19

    expired-url should be what you require. In the configuration for spring security

    <security:concurrent-session-control
      max-sessions="1" exception-if-maximum-exceeded="true" expired-url="/loginform.do" />
    

    also add following listener in web.xml.

    org.springframework.security.web.session.HttpSessionEventPublisher 
    
    0 讨论(0)
  • 2021-01-05 05:21

    spring-security-3.2.0 , message.properties :

    ConcurrentSessionControlAuthenticationStrategy.exceededAllowed = Maximum sessions of {0} for this principal exceeded

    0 讨论(0)
  • 2021-01-05 05:25

    Please keep this in your messages.properties

    ConcurrentSessionControlStrategy.exceededAllowed=This account is already using by someone.
    

    it will display "This account is already using by someone." you can give what ever you want.

    Also don't forget to config Resourcebundle

    0 讨论(0)
提交回复
热议问题