How can I get a list with all connected users?
How can I get a list with all connected users?
You could use the concurrent sessions handling architecture
static.springframework.org/spring-security/site/reference/html/authentication-common-auth-services.html#concurrent-sessions and use sessionRegistry.getAllPrincipals() methods, although that implementation would prevent simultaneous logins with the same credentials.
Thank you, it works very well. I need the list with the connected users in order to manage these users. In this way I can force to end the session for all connected users:
Object[] obj=sessionRegistry.getAllPrincipals();
for (Object o:obj){
SessionInformation[] sis= sessionRegistry.getAllSessions(o, true);
sis[0].expireNow();
}