title: How do I use a table other than "Users" for CakePHP's AuthComponent?
body: <p>CakePHP's <em><a href="http://api.cakephp.org/class/auth-component" rel="noreferrer">AuthComponent</a></em> assumes you have a Users table that contains a username and password. I'd like to find a way to override the default tablename from Users to Accounts.</p>
  
  <p><strong><em>Background Information:</em></strong></p>
  
  <p>The way I have designed my database is to have a Users table and an Accounts table.</p>
  
  <p><strong>Accounts</strong>:</p>
  
  <ul>
  <li><p>id</p></li>
  <li><p>user_id</p></li>
  <li><p>username</p></li>
  <li><p>password</p></li>
  <li><p>authentication service (for example, my site, Facebook, Google, <a href="http://en.wikipedia.org/wiki/OpenID" rel="noreferrer">OpenID</a>, etc.)</p></li>
  </ul>
  
  <p><strong>Users</strong>:</p>
  
  <ul>
  <li>simply has all the personal information of the user (age, gender, etc.)</li>
  </ul>
  
  <p>The reason for this is so that</p>
  
  <ol>
  <li>each user can have multiple accounts they can login from so they are not locked into one</li>
  <li>I can connect the third-party services to an account for more awesomeness</li>
  </ol>
  
  <p>Now back to the problem....</p>
  
  <p>CakePHP has documentation on changing the default field name, but I can't find anything on changing the default table name, but assume it would be similar in nature...</p>
  
  <p>Example of changing the default field name:</p>
  
  <pre><code>function beforeFilter() {
      $this-&gt;Auth-&gt;fields = array(
              'username' =&gt; 'username',
              'password' =&gt; 'secretword'
          );
   }
  </code></pre>
  
  <p><strong>Is there a way to accomplish this or should I restructure the tables keeping with CakePHP convention and still accomplish the same thing?</strong></p>