私はちょっとCakephp(3.5)の初心者です。私は現在いくつかのサブディレクトリを含む最初のプラグイン(Example
)を作ろうとしています。その1つはUserManager
ディレクトリであり、認証のあるユーザーMVC標準スーツが含まれています。CakePhp 3プラグイン認証アダプタが見つかりません
私は社会的なログインと他のstuffsを追加したいのでdocsで説明したように、私は私自身の認証コンポーネントを作成しました:
plugins/Example/UserManager/src/Controller/AppController.php
<?php
namespace Example\UserManager\Controller;
use App\Controller\AppController as BaseController;
class AppController extends BaseController
{
public function initialize()
{
parent::initialize();
$this->loadComponent('Auth', [
'authenticate' => [
'Example/UserManager.Example' => [
'fields' => ['username' => 'email', 'password' => 'pass'],
'userModel' => 'Users',
],
],
]);
}
}
<?php
namespace App\Auth;
use Cake\Auth\BaseAuthenticate;
use Cake\Http\ServerRequest;
use Cake\Http\Response;
class ExampleAuthenticate extends BaseAuthenticate
{
// The same as Form authentication, since I'm testing
}
を問題があります私は認証コンポーネントがExampleAuthenticate
クラスを見つけることができません。私はすでに
Example
ExampleAuthenticate
UserManager.Example
Example/UserManager.Example
Example\UserManager.Example
Example/UserManager.ExampleAuthenticate
Example\UserManager.ExampleAuthenticate
のような
authenticate
設定のparamを設定することで、試してみました
が、http://localhost/Project/example/user-manager/users
を訪れたとき、私は常にエラーAuthentication adapter "..." was not found.
を得る:(
を誰もが、私は失われるかもしれないものの任意の手掛かりを持っていますか?
私は深いプラグインのパスをサポートしていないと思います。 'plugins/Example'や' plugins/UserManager'のパスを使うべきです – kicaj
これは奇妙なことですが、これを試してみると、私は全く新しいミニマリストプロジェクトを作成しましたが、あなたの提案ではできません。カスタム認証の実装について、ドキュメントには記載されていないことはありますか? – Warren
ところで、 'authenticate'パラメータを' Form'に変更すると、すべてが魅力のようになります – Warren