<p dir="auto">I use Syimfony v2.5.7, and I set entry_point to id of my service that extends <strong>Symfony\Component\Security\Http\EntryPoint\FormAuthenticationEntryPoint</strong> class but symfony remains to call <strong>start</strong> method of <strong>Symfony\Component\Security\Http\EntryPoint\FormAuthenticationEntryPoint</strong> instead to call method from my implementation.</p>
<p dir="auto">I must crate compiler pass that replace <strong>security.authentication.form_entry_point</strong> definition with definition that use my entry point implementation to achieve this.</p>
<p dir="auto">I am not good at english and I will do my best to articulate..</p>
<p dir="auto">Yestoday, I have upgrade my Symfony framework from 2.3.18 to 2.3.22. Everything is good, except my  AuthenticationEntryPoint class.</p>
<p dir="auto">Code here:</p>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class AuthenticationEntryPoint implements AuthenticationEntryPointInterface
{
    private $router;

    public function __construct(Router $router)
    {
        $this-&gt;router = $router;
    }

    public function start(Request $request, AuthenticationException $exception)
    {
        if ($request-&gt;isXmlHttpRequest()) {
            return new JsonResponse(array('status' =&gt; 'login_required'));
        }
        return new RedirectResponse('/my/login');
    }
}"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-v">AuthenticationEntryPoint</span> <span class="pl-k">implements</span> <span class="pl-v">AuthenticationEntryPointInterface</span>
{
    <span class="pl-k">private</span> <span class="pl-c1"><span class="pl-c1">$</span>router</span>;

    <span class="pl-k">public</span> <span class="pl-k">function</span> <span class="pl-en">__construct</span>(<span class="pl-smi"><span class="pl-smi">Router</span></span> <span class="pl-s1"><span class="pl-c1">$</span>router</span>)
    {
        <span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>-&gt;<span class="pl-c1">router</span> = <span class="pl-s1"><span class="pl-c1">$</span>router</span>;
    }

    <span class="pl-k">public</span> <span class="pl-k">function</span> <span class="pl-en">start</span>(<span class="pl-smi"><span class="pl-smi">Request</span></span> <span class="pl-s1"><span class="pl-c1">$</span>request</span>, <span class="pl-smi"><span class="pl-smi">AuthenticationException</span></span> <span class="pl-s1"><span class="pl-c1">$</span>exception</span>)
    {
        <span class="pl-k">if</span> (<span class="pl-s1"><span class="pl-c1">$</span>request</span>-&gt;<span class="pl-en">isXmlHttpRequest</span>()) {
            <span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-v">JsonResponse</span>(<span class="pl-en">array</span>(<span class="pl-s">'status'</span> =&gt; <span class="pl-s">'login_required'</span>));
        }
        <span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-v">RedirectResponse</span>(<span class="pl-s">'/my/login'</span>);
    }
}</pre></div>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="services:
    my_entry_point:
        class: My\Bundle\Security\AuthenticationEntryPoint
        arguments: [ &quot;@router&quot; ]

security:
    firewalls:
        secured:
            pattern: .*
            entry_point: my_entry_point
            form_login:
                check_path: /my/login/check"><pre class="notranslate"><span class="pl-ent">services</span>:
    <span class="pl-ent">my_entry_point</span>:
        <span class="pl-ent">class</span>: <span class="pl-s">My\Bundle\Security\AuthenticationEntryPoint</span>
        <span class="pl-ent">arguments</span>: <span class="pl-s">[ "@router" ]</span>

<span class="pl-ent">security</span>:
    <span class="pl-ent">firewalls</span>:
        <span class="pl-ent">secured</span>:
            <span class="pl-ent">pattern</span>: <span class="pl-s">.*</span>
            <span class="pl-ent">entry_point</span>: <span class="pl-s">my_entry_point</span>
            <span class="pl-ent">form_login</span>:
                <span class="pl-ent">check_path</span>: <span class="pl-s">/my/login/check</span></pre></div>
<p dir="auto">The question is, if remove <code class="notranslate">form_login</code> from <code class="notranslate">security.yml</code>, <code class="notranslate">AuthenticationEntryPoint</code> running and got this exception:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Unable to find the controller for path &quot;/my/login/check&quot;. 
Maybe you forgot to add the matching route in your routing configuration?"><pre class="notranslate"><code class="notranslate">Unable to find the controller for path "/my/login/check". 
Maybe you forgot to add the matching route in your routing configuration?
</code></pre></div>
<p dir="auto">if leave <code class="notranslate">form_login</code> in <code class="notranslate">security.yml</code>, <code class="notranslate">AuthenticationEntryPoint</code> does not work, and the default <code class="notranslate">login_path</code> will be used:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="No route found for &quot;GET /login&quot;
404 Not Found - NotFoundHttpException"><pre class="notranslate"><code class="notranslate">No route found for "GET /login"
404 Not Found - NotFoundHttpException
</code></pre></div>
<p dir="auto">Thanks very much.</p>