title: Login [ Auth->identify() ] always false on CakePHP 3
body: <p>I started using CakePHP 3 after a time using CakePHP 2 and I am having troubles to create the authentication login.</p>
  
  <p>The new auth function <code>$this-&gt;Auth-&gt;identify()</code> always return false.</p>
  
  <p>On the database, the password are encrypted perfect and the query who takes the user it's ok too. </p>
  
  <p>My code:</p>
  
  <p>AppController:</p>
  
  <pre><code>[...]
  class AppController extends Controller{
      public function initialize(){
          $this-&gt;loadComponent('Flash');
          $this-&gt;loadComponent('Auth', [
              'loginRedirect' =&gt; [
                  'controller' =&gt; 'Admin',
                  'action' =&gt; 'index'
              ],
              'logoutRedirect' =&gt; [
                  'controller' =&gt; 'Pages',
                  'action' =&gt; 'display'
              ]
          ]);
      }
  
      public function beforeFilter(Event $event)
      {
          $this-&gt;Auth-&gt;allow(['display']);
      }
  }
  </code></pre>
  
  <p>UserController:</p>
  
  <pre><code>[...]
  class UsersController extends AppController{
      public function beforeFilter(Event $event)
      {
      parent::beforeFilter($event);
      $this-&gt;Auth-&gt;allow(['logout']);
      }
  [...]
      public function login()
      {
          if ($this-&gt;request-&gt;is('post')) {
              $user = $this-&gt;Auth-&gt;identify();
              if ($user) {
                  $this-&gt;Auth-&gt;setUser($user);
                  return $this-&gt;redirect($this-&gt;Auth-&gt;redirectUrl());
              }
              $this-&gt;Flash-&gt;error(__('Invalid username or password, try again'));
          }
      }
  [...]
  </code></pre>
  
  <p>User (Model Entity):</p>
  
  <pre><code>&lt;?php
  namespace App\Model\Entity;
  
  use Cake\Auth\DefaultPasswordHasher;
  use Cake\ORM\Entity;
  
  class User extends Entity{
      protected $_accessible = [*];
      protected function _setPassword($password){
          return (new DefaultPasswordHasher)-&gt;hash($password);
      }
  }
  </code></pre>
  
  <p>View:</p>
  
  <pre><code>&lt;div class="users form"&gt;
  &lt;?= $this-&gt;Flash-&gt;render('auth') ?&gt;
  &lt;?= $this-&gt;Form-&gt;create() ?&gt;
      &lt;fieldset&gt;
          &lt;legend&gt;&lt;?= __('Please enter your username and password') ?&gt;&lt;/legend&gt;
          &lt;?= $this-&gt;Form-&gt;input('username') ?&gt;
          &lt;?= $this-&gt;Form-&gt;input('password') ?&gt;
      &lt;/fieldset&gt;
  &lt;?= $this-&gt;Form-&gt;button(__('Login')); ?&gt;
  &lt;?= $this-&gt;Form-&gt;end() ?&gt;
  &lt;/div&gt;
  </code></pre>