Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>When using models that don't reflect CakePHP's conventions, there are a few things you can configure to get things working.</p> <p>When you create your User model (or whatever you have called it), you can specify <a href="http://book.cakephp.org/view/1058/useDbConfig" rel="nofollow noreferrer">which database</a> the table is in, what the <a href="http://book.cakephp.org/view/1059/useTable" rel="nofollow noreferrer">name of the table</a> is, if the <a href="http://book.cakephp.org/view/1060/tablePrefix" rel="nofollow noreferrer">table has a prefix</a>, what the <a href="http://book.cakephp.org/view/1061/primaryKey" rel="nofollow noreferrer">primary key field is called</a> (usually <code>id</code>), and what the <a href="http://book.cakephp.org/view/1062/displayField" rel="nofollow noreferrer">display field is</a> (usually <code>name</code> or <code>title</code>).</p> <p>When setting up <code>AuthComponent</code>, you can also specify what <a href="http://book.cakephp.org/1.3/en/The-Manual/Core-Components/Authentication.html#usermodel" rel="nofollow noreferrer">model to use</a> (usually <code>User</code>) and what the <a href="http://book.cakephp.org/view/1265/AuthComponent-Variables#fields-1267" rel="nofollow noreferrer">username and password fields</a> are called.</p> <p>A combination of the above configuration options should usually be enough to get CakePHP understanding how to your table schema is set up.</p> <p>However, in some cases this isn't enough, so you can override or extends parts of the core <code>AuthComponent</code> to get it working the way you want (usually just the <code>identify</code> method is needed, as you pointed out). A few example scenarios would be <a href="https://stackoverflow.com/questions/1397091/alternative-authentication-sources-in-cakephp-ldap/1399855#1399855">LDAP authentication</a>, trying to authenticate over <a href="https://stackoverflow.com/questions/2973620/cakephp-auth-with-multiple-users-tables/2974494#2974494">multiple User tables</a>, and trying to authenticate where there are <a href="https://stackoverflow.com/questions/1677532/cakephp-auth-component-using-2-tables/1701826#1701826">joined User and Email tables</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload