<table role="table">
<thead>
<tr>
<th>Q</th>
<th>A</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bug report?</td>
<td>no</td>
</tr>
<tr>
<td>Feature request?</td>
<td>yes</td>
</tr>
<tr>
<td>BC Break report?</td>
<td>no</td>
</tr>
<tr>
<td>RFC?</td>
<td>no</td>
</tr>
<tr>
<td>Symfony version</td>
<td>3.3.0</td>
</tr>
</tbody>
</table>
<p dir="auto">I have recently started using the Guard component to handle formless authentication. Great addition BTW (Thanks <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/weaverryan/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/weaverryan">@weaverryan</a>).</p>
<p dir="auto">With the traditional <code class="notranslate">'form_login'</code>, we have the option to add many routes directly under the <code class="notranslate">'firewalls'</code> key. For example the <code class="notranslate">'default_target_path'</code>. Using <code class="notranslate">'guard'</code> we don't have these options. I understand that any key/value pairs can be defined under the implementing bundle, but IMO bundle configuration and firewall configurations should be separate.</p>
<p dir="auto">Would it be possible to add the configurations, under 'guard',  for <code class="notranslate">'default_target_path</code>', <code class="notranslate">'always_use_default_target_path</code>', <code class="notranslate">'use_referer</code>', <code class="notranslate">'login_path</code>' and <code class="notranslate">'failure_path</code>'. Then make these configurations available, as possibly a container parameter, so they can be passed into our 'GuardAuthenticator' constructor?</p>
<p dir="auto">This will keep firewall configuration nice and tidy, and also allow for the easier development of 3rd party bundles.</p>
<table role="table">
<thead>
<tr>
<th>Q</th>
<th>A</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bug report?</td>
<td>no</td>
</tr>
<tr>
<td>Feature request?</td>
<td>maybe?</td>
</tr>
<tr>
<td>BC Break report?</td>
<td>no</td>
</tr>
<tr>
<td>RFC?</td>
<td>no</td>
</tr>
</tbody>
</table>
<p dir="auto">What is the recommended way to do per-firewall guard configuration options? Just add logic based on the request in the Guard? My current use case is redirection settings. Based on what firewall you are using a Guard from you might want different redirection to occur. It would be nice to define some configuration options like this per firewall like you can with the form_login approach.</p>
<p dir="auto">Currently it seems like the only way would be to add logic to the <code class="notranslate">onAuthenticationSuccess()</code> and <code class="notranslate">onAuthenticationFailure()</code> methods and inspect the Request object. Maybe it should stay that way due to the generic nature of the Guard in general? Thoughts?</p>