CakePHP 1.3에서 2.0.4로 앱을 업그레이드했습니다.Cakephp 2.0 및 기본 인증
이전에는 하나의 컨트롤러에서만 기본 HTTP 인증을 에뮬레이트하기 위해 보안 구성 요소를 사용할 수있었습니다.
나는 이런 일을 수행하는 데 사용 :$this->Auth->allow(array('*'));
$this->Security->loginOptions = array('type'=>'basic','realm'=>'api');
$this->Security->loginUsers = array("api"=>"123");
$this->Security->requireLogin();
이제 SecurityComponent 더 이상 기본 및 다이제스트 인증 처리를하고 나는 같은 것을 수행해야합니다
public $components = array(
'Auth' => array(
'authenticate' => array('Basic')
)
);
을하지만 난에이를 사용할 때 내 ApiController는/users/login의 로그인 양식으로 리디렉션됩니다. 내가 놓친 게 있니?
행운이 있나요? –