Mayank
Mayank

Reputation: 1

Getting no. of currently logged in users in Spring security

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.But I couldn't get the actual implementation of the same.

Thanks in Advance, Mayank

Upvotes: 0

Views: 438

Answers (1)

Ritesh
Ritesh

Reputation: 7522

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

Upvotes: 1

Related Questions