user2559230
user2559230

Reputation: 11

Symfony 2 error: ....must be an instance of Symfony\Component\Security\Http\HttpUtils in services.yml

I am passing an argument from services.yml to an authentication handler, and getting this error:

....must be an instance of Symfony\Component\Security\Http\HttpUtils

This is the class:

class AuthenticationFailure extends DefaultAuthenticationFailureHandler
{
    public function onAuthenticationFailure(Request $request, AuthenticationException $exception)
    {

I have tried all of these but none work:

What am I missing?

So I just need to know what service do I pass that is an instance of Symfony\Component\Security\Http\HttpUtils

Upvotes: 1

Views: 451

Answers (1)

K-Alex
K-Alex

Reputation: 380

Try this:

services:
    http.utils.class:
        class: Symfony\Component\Security\Http\HttpUtils
    security.authentication.your_success_handler:
        class: %security.authentication.success_handler.class%
        public: false
        arguments:  [@http.utils.class, [], ...]

Upvotes: 1

Related Questions