<p dir="auto"><strong>Description</strong><br>
For an real world application im using an API to authenticate that is build in symfony as well and handles all the roles and al other security things for the frontend i want to use the symfony 4 framework as well and that it use the authentication over the API.<br>
The API will provide the authentication user, token and roles so the frontend framework can use this to signin.<br>
In the previous this is possible but since all class that could have do this is deprecated and uses guard which requires an user entity what i don't want because i don't want duplicate user databases because it's already in the API.</p>
<p dir="auto"><strong>Example</strong><br>
So my idea was an authenticator class to provide the support and authentication the authentication will returns the required userinterface with the username and roles to fake the user identity so it can log in the user and use all the security features like '@security'</p>
<p dir="auto"><em>(this issue is part of the <a href="http://symfony.com/blog/making-the-symfony-experience-exceptional" rel="nofollow">"DX" ("Developer eXperience") initiative</a> introduced by Symfony project)</em></p>
<p dir="auto">On the symfony-docs repository there is a <a href="https://github.com/symfony/symfony-docs/issues/3849" data-hovercard-type="issue" data-hovercard-url="/symfony/symfony-docs/issues/3849/hovercard">very long discussion</a> about the new template naming syntax.</p>
<p dir="auto">In short, some people think that the old syntax has inconsistencies in cases like the following:</p>
<ul dir="auto">
<li>Resource: <code class="notranslate">@AcmeBlogBundle/Resources/views/Default/common/template4.html.twig</code></li>
<li>Template: <code class="notranslate">AcmeBlogBundle : Default : common / template4.html.twig</code></li>
<li>Also valid: <code class="notranslate">AcmeBlogBundle : Default / common : template4.html.twig</code></li>
</ul>
<p dir="auto">Using the new namespaced Twig syntax, the template name would always be:</p>
<p dir="auto"><code class="notranslate">@AcmeBlog/Default/common/template4.html.twig</code></p>
<p dir="auto">Removing the <code class="notranslate">Resources/views/</code> part is very common and easy to understand. But removing the <code class="notranslate">Bundle</code> suffix is really strange and inconsistent with the rest of Symfony.</p>
<p dir="auto">This problem is introduced in <a href="https://github.com/symfony/symfony/blob/a12db9bbd7813ec710d584ca56b8da2c66e1c4df/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php#L136-138">lines 136-138 of TwigBundle/DependencyInjection/TwigExtension.php file</a>.</p>
<h4 dir="auto">Summarized Proposals</h4>
<p dir="auto">Deprecate the current behavior (0) and choose one of the following to implement and recommend:</p>
<table role="table">
<thead>
<tr>
<th>Prop</th>
<th>Template</th>
<th>Notes</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td><code class="notranslate">AcmeBlogBundle:Default:index.html.twig</code></td>
<td>current</td>
</tr>
<tr>
<td>1</td>
<td><code class="notranslate">@AcmeBlogBundle/Default/index.html.twig</code></td>
<td>Assumed <code class="notranslate">Resources/views</code></td>
</tr>
<tr>
<td>2</td>
<td><code class="notranslate">@AcmeBlogBundle:Default/index.html.twig</code></td>
<td>Assumed <code class="notranslate">Resources/views</code></td>
</tr>
<tr>
<td>3</td>
<td><code class="notranslate">AcmeBlogBundle:Default/index.html.twig</code></td>
<td>Assumed <code class="notranslate">Resources/views</code></td>
</tr>
<tr>
<td>4</td>
<td><code class="notranslate">@AcmeBlogBundle:views/Default/index.html.twig</code></td>
<td>Assumed <code class="notranslate">Resources</code>, could also be used consistent with routing imports</td>
</tr>
<tr>
<td>5</td>
<td><code class="notranslate">AcmeBlogBundle:views/Default/index.html.twig</code></td>
<td>Assumed <code class="notranslate">Resources</code></td>
</tr>
<tr>
<td>6</td>
<td><code class="notranslate">view@AcmeDemoBundle/Default/index.html.twig</code></td>
<td>we might also have <code class="notranslate">public@</code>, <code class="notranslate">config@</code> that could be used elsewhere</td>
</tr>
</tbody>
</table>