title: Spring Security 4 sessionRegistry doesn't populate Principal list
body: <p>I am trying to implement a function where a admin user can terminate another user's session. I followed the official Spring Security documentation here: <a href="http://docs.spring.io/spring-security/site/docs/current/reference/htmlsingle/#list-authenticated-principals" rel="nofollow">http://docs.spring.io/spring-security/site/docs/current/reference/htmlsingle/#list-authenticated-principals</a> and started with getting all currently logged in users through <code>sessionRegistry.getAllPrincipals()</code>, but it always returned an empty list.</p>
  
  <p>I set a breakpoint in SessionRegistryImpl.registerNewSession() and could see it did indeed get invoked and it did add the <code>UserDetails</code> (my own implementation with both equals() and hashCode() implemented) to the hashmap <code>principals</code>. But when I access sessionRegistry bean from a Spring MVC controller, the list is always empty.</p>
  
  <p>My configuration looks pretty much the same as the <a href="http://docs.spring.io/spring-security/site/docs/current/reference/htmlsingle/#concurrent-sessions" rel="nofollow">documentation</a>.</p>
  
  <p>How to fix this? Did anyone successfully get SessionRegistry to work with Spring Security 4? I remember I made it work with Spring Security 3 by following these intructions(<a href="http://krams915.blogspot.com/2010/12/spring-security-mvc-querying.html" rel="nofollow">enter link description here</a>)</p>