1

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:

  • @http_kernel
  • @request
  • @security.access.decision_manager
  • @security.context
  • @security.authentication.manager
  • @security.secure_random
  • @security.firewall
  • @service_container

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

6
  • show us the constructor, if you're injecting it via ctor. (surely in DefaultAuthenticationFailureHandler` ) Commented Jul 8, 2013 at 8:29
  • and a more complete error meesage. Commented Jul 8, 2013 at 8:30
  • No way do you need any of this information to answer this question Commented Jul 8, 2013 at 9:41
  • Answer is: @security_http_utils Commented Jul 8, 2013 at 9:42
  • 1
    @security.http_utils Commented Oct 31, 2014 at 9:39

1 Answer 1

1

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, [], ...]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.