I upgraded my application from CakePHP 1.3 to 2.0.4.
Previously, I could use the Security component to emulate basic HTTP authentication in only one controller.
I was doing something like this:
$this->Auth->allow(array('*'));
$this->Security->loginOptions = array('type'=>'basic','realm'=>'api');
$this->Security->loginUsers = array("api"=>"123");
$this->Security->requireLogin();
Now SecurityComponent no longer handles Basic and Digest authentication, and I need to do something like this:
public $components = array(
'Auth' => array(
'authenticate' => array('Basic')
)
);
But when I use this on my ApiController, it redirects to my login form in / users / login. Did I miss something?
source
share