I have created a CustomAuthenticate class as follows and placed it under app/Controller/Component/Auth. I have a model ‘User’ and a corresponding ‘users’ table in the sqlite database. Though i didnt want the table ‘users’, it does not work otherwise. But now after hitting ‘login’ on the form. It errors out with the following trace
2012-10-10 00:57:59 Error: [CakeException] Authentication adapter "Custom" was not found.
#0 C:\Program Files (x86)\Ampps\www\application1\lib\Cake\Controller\Component\AuthComponent.php(630): AuthComponent->constructAuthenticate()
#1 C:\Program Files (x86)\Ampps\www\application1\lib\Cake\Controller\Component\AuthComponent.php(510): AuthComponent->identify(Object(CakeRequest), Object(CakeResponse))
#2 C:\Program Files (x86)\Ampps\www\application1\app\Controller\UsersController.php(70): AuthComponent->login()
#3 [internal function]: UsersController->login()
#4 C:\Program Files (x86)\Ampps\www\application1\lib\Cake\Controller\Controller.php(485): ReflectionMethod->invokeArgs(Object(UsersController), Array)
#5 C:\Program Files (x86)\Ampps\www\application1\lib\Cake\Routing\Dispatcher.php(186): Controller->invokeAction(Object(CakeRequest))
#6 C:\Program Files (x86)\Ampps\www\application1\lib\Cake\Routing\Dispatcher.php(161): Dispatcher->_invoke(Object(UsersController), Object(CakeRequest), Object(CakeResponse))
#7 C:\Program Files (x86)\Ampps\www\application1\app\webroot\index.php(92): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse))
#8 {main}
The AppController has the following in the component array.
public $components = array(
'Session',
'Auth' => array(
'loginRedirect' => array('controller' => 'ananlyze', 'action' => 'index'),
'logoutRedirect' => array('controller' => 'users', 'action' => 'login', 'home'),
'authenticate' => array('Custom','Form')
)
);
Appreciate your help.
Have you called
App::uses('CustomAuthenticate', 'Controller/Component/Auth');in AppController?