title: debug AuthComponent in cakephp 2.4
body: <p>I baked a cakephp application with a users table, and I'm trying to get authentication to work using the Blowfish hash. My password field is a varchar(255), so it should be long enough to store the hash. Everything in the app is the default baked output, expect for what follows.</p>
  
  <p>This issue is that I can't log in after creating a user; I always get "Access Denied". What's the best way of troubleshooting this?</p>
  
  <p>AppController.php</p>
  
  <pre><code>App::uses('Controller', 'Controller');
  
  class AppController extends Controller {
      public function beforeFilter(){
          $this-&gt;Auth-&gt;allow('index', 'view');
      }
  
      public $components = array(
          'Session',
          'Auth' =&gt; array(
              'authenticate' =&gt; array(
                  'Form' =&gt; array(
                      'fields' =&gt; array('username' =&gt; 'email'),
                      'passwordHasher' =&gt; 'Blowfish'
                      )
                  ),
              'loginRedirect' =&gt; array('controller' =&gt; 'users', 'action' =&gt; 'index'),
              'logoutRedirect' =&gt; array('controller' =&gt; 'users', 'action' =&gt; 'index'),
              'authError' =&gt; "Access Denied",
              'authorize' =&gt; array('Controller'),
          )
      );
  
      public function isAuthorized($user){
          return true;
      }
  }
  </code></pre>
  
  <p>User.php (model)</p>
  
  <pre><code>App::uses('AppModel', 'Model');
  App::uses('BlowfishPasswordHasher', 'Controller/Component/Auth');
  
  public function beforeSave($options = array()) {
      if (!empty($this-&gt;data['User']['password'])) {
          $passwordHasher = new BlowfishPasswordHasher();
          $this-&gt;data['User']['password'] = $passwordHasher-&gt;hash($this-&gt;data['User']['password']);
      }
      return true;
  }
  </code></pre>
  
  <p>UsersController.php</p>
  
  <pre><code>public function login(){
      if ($this-&gt;request-&gt;is('post')) {
          if($this-&gt;Auth-&gt;login()) {
              $this-&gt;redirect($this-&gt;Auth-&gt;redirect());
          }
          else {
              $this-&gt;Session-&gt;setFlash('Access Denied');
          }
      }
  }
  </code></pre>
  
  <p>login.ctp</p>
  
  <pre><code>echo $this-&gt;Form-&gt;create('user');
  echo $this-&gt;Form-&gt;input('email');
  echo $this-&gt;Form-&gt;input('password');
  echo $this-&gt;Form-&gt;button('Log In', array('type' =&gt; 'submit');
  echo $this-&gt;Form-&gt;end();
  </code></pre>
  
  <p>'debug($this->request); die;' in login function gives the following output. should password be <strong>*</strong> or should it be the hashed version of the input? </p>
  
  <pre><code>data =&gt; array(
      'user' =&gt; array(
          'password' =&gt; '*****',
          'email' =&gt; 'test@test.com'
      )
  )
  </code></pre>