title: Atmosphere: How to get logged in user from webSocket connection in Grails?
body: <p>I am working on bringing WebSockets functionality to my Grails application. I use Atmosphere Meteor plugin 0.7.1 for this purpose.
  The workflow is simple:</p>
  
  <ul>
  <li>User logs in the system. </li>
  <li>User open page with WebSockets functionality</li>
  <li>User clicks a Connect button to establish the connection... <strong>and the server doesn't recognize him.</strong></li>
  </ul>
  
  <p>I would like to know which user connected my webSocket.</p>
  
  <p>Usually it's quite easy to detect current user by calling <code>springSecurityService.getPrincipal()</code> in any controller. I managed to inject <code>springSecurityService</code> to my MeteorHandler, however it says that the principal is <code>null</code>. It feels strange for me, as the handler has access to <code>JSESSIONID</code> cookie, so I expect it to retrieve the correct session data.</p>
  
  <p>Also, <code>request.session</code> command returns different HttpSession object, compared to the same command performed in regular controller action.</p>
  
  <p>So is there any way to retrieve current logged in user on webSockets connection?</p>
  
  <p>Thanks in advance.</p>