【发布时间】:2013-11-10 08:14:25
【问题描述】:
我目前正在为我的网站开发一个 Restfull API。 我决定把它开发成一个插件。
我正在使用扩展 BasicAuthentification 的自定义类。它允许我检查客户端应用凭据,以便将 API 的使用限制为仅限于经过批准的开发人员。
此文件在添加到 CakePHP CORE 时完美运行:Cake/Controller/Component/Auth/DeviceAuthentification.php
由于我正在开发一个插件,我希望所有内容都在同一个目录中。
因此,在名为MyApi 的插件目录中,我在以下路径中添加了我的自定义类:
MyApi/Controller/Auth/DeviceAuthentification.php
为了加载它,在我的插件控制器MyApiAppController 中,我添加了以下代码:
public $components = array(
'Auth' => array(
'authenticate' => 'Device', // I also tried MyApi.Device
'sessionKey' => false
)
);
加载不出来,报错如下:
未找到身份验证适配器“设备”。
有人有想法吗?
【问题讨论】:
标签: cakephp plugins basic-authentication restful-authentication