<p dir="auto">Hello,</p>
<p dir="auto">I find <code class="notranslate">IS_AUTHENTICATED_REMEMBERED</code> / <code class="notranslate">IS_AUTHENTICATED_FULLY</code> attributes to poorly convey what they mean and what they do. This issue is here to discuss and propose a few ideas to make authentication checks more explicit and elegant.</p>
<p dir="auto"><strong>Detailled reasoning</strong></p>
<p dir="auto">At the moment, to check if a User is logged to the application by any mean, we should check <code class="notranslate">IS_AUTHENTICATED_REMEMBERED</code> attribute. In my opinion the name is not intuitive, I see no reason for the name to relate to a "remember me" feature we may not have on the application. Also I don't see any reason why "fully authenticated" users inherits <code class="notranslate">IS_AUTHENTICATED_REMEMBERED</code> attribute, it makes finding users who use remember_me less elegant (see example 3).</p>
<p dir="auto">In real-world scenarios, developers starting to develop a Symfony application are likely to use <code class="notranslate">IS_AUTHENTICATED_FULLY</code>. But it is making adding the "remember me" feature later harder, since all checks will have to be modified back to <code class="notranslate">IS_AUTHENTICATED_REMEMBERED</code> or users enabling remember me won't be able to access part of the application.</p>
<p dir="auto">The same reasoning can be applied to <code class="notranslate">IS_AUTHENTICATED_ANONYMOUSLY</code>, I don't see any reason why fully-fledged users get this attribute.</p>
<p dir="auto"><strong>Propositions</strong></p>
<p dir="auto">Here is a few ideas, some being independent from each other:</p>
<ol dir="auto">
<li>add a <code class="notranslate">IS_AUTHENTICATED</code> attribute, which would be granted to any non-anonymously authenticated user, no matter how</li>
<li>add <code class="notranslate">IS_AUTHENTICATED_REMEMBER_ME</code> attribute, which only authenticated through a remember me mechanism (cookie...) will get - and only them</li>
<li>either keep <code class="notranslate">IS_AUTHENTICATED_FULLY</code> or rename it to <code class="notranslate">IS_AUTHENTICATED_FRESH</code> (to discuss, I find "fresh" to be more explicit)</li>
<li>add <code class="notranslate">IS_ANONYMOUS</code> which will be given only to anonymous users</li>
<li>deprecate <code class="notranslate">IS_AUTHENTICATED_REMEMBERED</code> and <code class="notranslate">IS_AUTHENTICATED_ANONYMOUSLY</code></li>
</ol>
<p dir="auto">Deprecated attributes could be dropped (or not) in Symfony 5, for backward-compatibility.<br>
Regarding code, <code class="notranslate">AuthenticatedVoter</code> &amp; related tests should be modified, it looks to be relatively easy.</p>
<p dir="auto"><strong>Code examples</strong></p>
<p dir="auto">Checking an user is connected:</p>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// Before - not having &quot;remember_me&quot; enabled
$this-&gt;get('security.authorization_checker')-&gt;isGranted(`IS_AUTHENTICATED_FULLY`)

// Also before - eventually having &quot;remember_me&quot; in the app
$this-&gt;get('security.authorization_checker')-&gt;isGranted(`IS_AUTHENTICATED_REMEMBERED`)

// After
$this-&gt;get('security.authorization_checker')-&gt;isGranted(`IS_AUTHENTICATED`)"><pre class="notranslate"><span class="pl-c">// Before - not having "remember_me" enabled</span>
<span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>-&gt;<span class="pl-en">get</span>(<span class="pl-s">'security.authorization_checker'</span>)-&gt;<span class="pl-en">isGranted</span>(`IS_AUTHENTICATED_FULLY`)

<span class="pl-c">// Also before - eventually having "remember_me" in the app</span>
<span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>-&gt;<span class="pl-en">get</span>(<span class="pl-s">'security.authorization_checker'</span>)-&gt;<span class="pl-en">isGranted</span>(`IS_AUTHENTICATED_REMEMBERED`)

<span class="pl-c">// After</span>
<span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>-&gt;<span class="pl-en">get</span>(<span class="pl-s">'security.authorization_checker'</span>)-&gt;<span class="pl-en">isGranted</span>(`IS_AUTHENTICATED`)</pre></div>
<p dir="auto">Checking an user connected during the same session:</p>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// Before
$this-&gt;get('security.authorization_checker')-&gt;isGranted(`IS_AUTHENTICATED_FULLY`)

// After (tbd)
$this-&gt;get('security.authorization_checker')-&gt;isGranted(`IS_AUTHENTICATED_FULLY`)"><pre class="notranslate"><span class="pl-c">// Before</span>
<span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>-&gt;<span class="pl-en">get</span>(<span class="pl-s">'security.authorization_checker'</span>)-&gt;<span class="pl-en">isGranted</span>(`IS_AUTHENTICATED_FULLY`)

<span class="pl-c">// After (tbd)</span>
<span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>-&gt;<span class="pl-en">get</span>(<span class="pl-s">'security.authorization_checker'</span>)-&gt;<span class="pl-en">isGranted</span>(`IS_AUTHENTICATED_FULLY`)</pre></div>
<p dir="auto">Checking an user is connected thanks to "remember_me" feature (cookie...):</p>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// Before
$this-&gt;get('security.authorization_checker')-&gt;isGranted(`IS_AUTHENTICATED_REMEMBERED`)
 &amp;&amp; !$this-&gt;get('security.authorization_checker')-&gt;isGranted(`IS_AUTHENTICATED_FULLY`)

// After (tbd)
$this-&gt;get('security.authorization_checker')-&gt;isGranted(`IS_AUTHENTICATED_REMEMBER_ME`)"><pre class="notranslate"><span class="pl-c">// Before</span>
<span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>-&gt;<span class="pl-en">get</span>(<span class="pl-s">'security.authorization_checker'</span>)-&gt;<span class="pl-en">isGranted</span>(`IS_AUTHENTICATED_REMEMBERED`)
 &amp;&amp; !<span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>-&gt;<span class="pl-en">get</span>(<span class="pl-s">'security.authorization_checker'</span>)-&gt;<span class="pl-en">isGranted</span>(`IS_AUTHENTICATED_FULLY`)

<span class="pl-c">// After (tbd)</span>
<span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>-&gt;<span class="pl-en">get</span>(<span class="pl-s">'security.authorization_checker'</span>)-&gt;<span class="pl-en">isGranted</span>(`IS_AUTHENTICATED_REMEMBER_ME`)</pre></div>
<p dir="auto">Checking for an anonymous user:</p>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// Before
$this-&gt;get('security.authorization_checker')-&gt;isGranted(`IS_AUTHENTICATED_ANONYMOUSLY`) 
 &amp;&amp; !$this-&gt;get('security.authorization_checker')-&gt;isGranted(`IS_AUTHENTICATED_REMEMBERED`)

// After
$this-&gt;get('security.authorization_checker')-&gt;isGranted(`IS_ANONYMOUS`)"><pre class="notranslate"><span class="pl-c">// Before</span>
<span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>-&gt;<span class="pl-en">get</span>(<span class="pl-s">'security.authorization_checker'</span>)-&gt;<span class="pl-en">isGranted</span>(`IS_AUTHENTICATED_ANONYMOUSLY`) 
 &amp;&amp; !<span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>-&gt;<span class="pl-en">get</span>(<span class="pl-s">'security.authorization_checker'</span>)-&gt;<span class="pl-en">isGranted</span>(`IS_AUTHENTICATED_REMEMBERED`)

<span class="pl-c">// After</span>
<span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>-&gt;<span class="pl-en">get</span>(<span class="pl-s">'security.authorization_checker'</span>)-&gt;<span class="pl-en">isGranted</span>(`IS_ANONYMOUS`)</pre></div>
<p dir="auto">Thanks for reading!</p>
<table role="table">
<thead>
<tr>
<th>Q</th>
<th>A</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bug report?</td>
<td>yes</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>2.8.20</td>
</tr>
</tbody>
</table>
<p dir="auto">Hello everbody,</p>
<p dir="auto">I'm testing the LanguageBundle in Intl extension, and I found inconsistency in the language listing.</p>
<p dir="auto"><strong>Examples:</strong><br>
In the file <strong>Intl/Resources/data/language/pt.json</strong> don't have any key called "pt_BR", but in the file <strong>Intl/Resources/data/language/en.json</strong> the key exists.</p>
<p dir="auto">In addition to the above problem, we have a lack of standard language keys, where in some cases they are defined in ISO 639-1 and other ISO 639-2.</p>
<p dir="auto">I know Symfony uses data from the <a href="http://site.icu-project.org/" rel="nofollow">International Components for Unicode</a> library, but these inconsistencies are creating a uselessness in this feature. Would not it be better to create our own data source?</p>
<p dir="auto">Thanks!</p>