I'm trying to count failed and successful logins for my users. For that, I simply want to increase the respective counter in the datebase whenever an authentication attempt succeeds or fails. But I want to keep the default behavior without reinventing it.
So I followed this post: Symfony2 hold behavior when extending DefaultAuthenticationSuccessHandler
But apparently I cannot add any parameters to the constructor of my subclass of DefaultAuthenticationSuccessHandler or Symfony complains that the argument types are wrong.
How can I inject my user management service as a constructor parameter??
EDIT: Actually, the problem seems to be a little bit different! I have the following line in my services.yml:
services:
security.authentication.success_handler:
class: %security.authentication.success_handler.class%
arguments: [@my_stuff.my_user_management_service, @security.http_utils, {}]
But the second argument passed to the constructor is an array containing the options like "login_path". But it's supposed to be an instance of HttpUtils. I'm confused...