Newbie question about injecting service in controller without authentication

I play around with the examples from the documentation.
But when i want to inject a service into the constructor of a controller

   public function __construct(UserAvatarService $userAvatarService)
        $this->userAvatarService = $userAvatarService;

i get following error:

The request object does not contain the required authentication attribute

When i put


into the beforeFilter Section of the AppController, i get an error with too many redirects.

Has anyone a good solution to inject a service into an controller without these authentification issues?


Dont use the constructor of the controller. Just append your service to the parameters of your function where you need it.