title: Symfony 4 Event Subscriber User
body: <p>I created a middleware/event subscriber to generalise a few security checks I need to perform on routes with a specific request attribute.</p>
  
  <p>But in order to perform the required database query I need to get access to the authenticated user.</p>
  
  <p>When I call <code>$event-&gt;getRequest()-&gt;getUser()</code> it always returns <code>null</code> even when the user is authenticated.</p>
  
  <p>Where can I find more information about this?</p>
  
  <p>And one more question: is using <code>EventSubscribers</code> a good practice for my needs?</p>
  
  <p>Thanks in advance.</p>