title: Users Authentication fail
body: <p>So this is my login method:</p>
  
  <pre><code>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());
              } else {
                  $this-&gt;Flash-&gt;error(__('Invalid username or password, try again'));
              }
  
          }
      }
  </code></pre>
  
  <p>And this is how I has my password inside my User entity:</p>
  
  <pre><code>&lt;?php
  namespace App\Model\Entity;
  
  use Cake\Auth\DefaultPasswordHasher;
  use Cake\ORM\Entity;
  
  /**
   * User Entity.
   */
  class User extends Entity
  {
  
      /**
       * Fields that can be mass assigned using newEntity() or patchEntity().
       *
       * @var array
       */
      protected $_accessible = array(
          'first_name' =&gt; true,
          'last_name' =&gt; true,
          'email' =&gt; true,
          'username' =&gt; true,
          'password' =&gt; true,
          'role' =&gt; true,
          'created' =&gt; true
      );
      protected function _setPassword($password)
      {
          return (new DefaultPasswordHasher)-&gt;hash($password);
      }
  }
  </code></pre>
  
  <p>I already have working user registration and it's working without problems(password is being hashed), but for some reason I can't login, it always says that </p>
  
  <blockquote>
    <p>Invalid username or password, try again</p>
  </blockquote>
  
  <p>But those are present in my table, here is the query:</p>
  
  <pre><code>SELECT 
      Users.id AS `Users__id`, 
      Users.first_name AS `Users__first_name`, 
      Users.last_name AS `Users__last_name`, 
      Users.email AS `Users__email`, 
      Users.username AS `Users__username`, 
      Users.password AS `Users__password`, 
      Users.role AS `Users__role`, 
      Users.created AS `Users__created` 
  FROM 
      users Users 
  WHERE 
      Users.username = 'admin' LIMIT 1
  </code></pre>
  
  <p>But for some reason it does nothing in my app. I guess something is wrong with the password?</p>
  
  <p>Form:</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>
  
  <p>AppController:</p>
  
  <pre><code>class AppController extends Controller
  {
  
      /**
       * Initialization hook method.
       *
       * Use this method to add common initialization code like loading components.
       *
       * @return void
       */
      public function initialize()
      {
          $this-&gt;loadComponent('Flash');
          $this-&gt;loadComponent('Auth', [
              'loginRedirect' =&gt; [
                  'controller' =&gt; 'Jobs',
                  'action' =&gt; 'index'
              ],
              'logoutRedirect' =&gt; [
                  'controller' =&gt; 'Jobs',
                  'action' =&gt; 'index'
              ],
              'authorize' =&gt; ['controller']
          ]);
      }
  
      public function beforeFilter(Event $event)
      {
          $this-&gt;Auth-&gt;allow(['index', 'browse', 'view', 'register']);
      }
  }
  </code></pre>