title: Access UserDetails object in Websocket session Spring MVC
body: <p>In a call sent over a websocket connection in a Spring MVC 4 application, I can get a <code>java.security.Principal</code> object when adding this as a parameter in the method.</p>
  
  <p>However, this basicly only has the username in it, and I need the (extended) <code>UserDetails</code> object created during logging in. </p>
  
  <p><code>SecurityContextHolder.getContext().getAuthentication()</code> returns <code>null</code>. As I understood because spring creates a special session for handling the websocket connections.</p>
  
  <p>The Question: Is there a way to access the securitycontext from inside the websocket session/thread?</p>
  
  <p>(Being able to access a session bean would suffice as well).</p>