I’m upgrading a CakePHP 1.3 app to 2.0.3.
Previously, I was able to use the Auth component to log users in, and use the Security component to emulate Basic HTTP authentication. (as if I had setup an .htaccess file to password protect a page)
I used to do this:
$this->Security->loginOptions = array('type'=>'basic','realm'=>'training');
$this->Security->loginUsers = array("student"=>"student2010");
$this->Security->requireLogin();
Now it appears that even if I use:
public $components = array(
'Auth' => array(
'authenticate' => array('Basic')
)
);
It still wants to use my User model and database. Am I missing something?
Looking at the BaseAuthenticate and BasicAuthenticate classes would suggest that Cake no longer supports defining users and passwords that way.
You would probably have to extend the BasicAuthenticate class and override it’s getUser() method.
Perhaps someone else could shed some light on this?