开发者

Getting no. of currently logged in users in Spring security

开发者 https://www.devze.com 2023-02-20 17:08 出处:网络
hi I am using Spring security 2.0.5 in my current project. Can anybody please suggest me on how to get the count of currently logged in users to application.

hi I am using Spring security 2.0.5 in my current project. Can anybody please suggest me on how to get the count of currently logged in users to application. I found a solution in forums for Security 3.0 using ConcurrentSessionControlStrategy but since it is not in 2.0.5, and it is not feasible for me to currently advance to 3.0 It is mentioned in a post in 'stack Overflow' to use ConcurrentSessionControllerImpl for the same.Bu开发者_StackOverflowt I couldn't get the actual implementation of the same.

Thanks in Advance, Mayank


Simply declare a bean of class SessionRegistryImpl and inject it in your bean and use its getAllPrincipals method.

0

精彩评论

暂无评论...
验证码 换一张
取 消