###前提・実現したいこと
CAKEPHP3.4.11を利用してログインが出来るWebサイトを作成しており、
現在ログインの認証に失敗する現象が発生しており、原因がわからず、作業が
中断しています。どなたかお知恵をお貸しください。
**過去ログは参照しています**が、どれを参考にしても解決できないので投稿させていただいております
###発生している問題・エラーメッセージ
AuthのIdentifyにてFALSEが返却されてログインが出来ません。
###該当のソースコード
HogehogesのController ************************* public function initialize() { parent::initialize(); // debug $hasher = new DefaultPasswordHasher(); if($hasher->check('hogehoge', '$2y$10$dDar5Mep3cp.L0FJ7EIUe.NRpXVxQ2MEm65rHzXH.Pk3c4Nkq0swq')){ debug('Password is Correct'); }else{ debug('Password is Wrong'); } // debug $this->loadComponent('Auth', [ 'loginAction' => [ 'controller' => 'Hogehoges', 'action' => 'login', ], // 'loginRedirect' => [ // 'controller' => 'Hogehoges', // 'action' => 'home' // ], 'authenticate' => [ 'Form' => [ 'userModel' => 'Hogehoges', 'fields' => ['username' => 'email', 'password' => 'password'] ] ] ]); } ************************* public function login() { if ($this->request->is('post')) { $Hogehoges= $this->Auth->identify(); var_dump($this->Auth); var_dump($this); if ($Hogehoges) { $this->Auth->setUser($Hogehoges); return $this->redirect($this->Auth->redirectUrl()); } $this->Flash->error(__('LOGIN_ERR')); } } ************************* application.php //-------------------------------------------------------------------------- //初期処理 //-------------------------------------------------------------------------- public function initialize() { $this->loadComponent('Flash'); $this->loadComponent('RequestHandler'); // RequestHandlerコンポーネント。入力されたデータの取得などに使用 }
###試したこと
入力したパスワードのハッシュ化後の値と、DBの登録されたパスワードの比較をしたところ
一致しています。
上の// debug部分です
###補足情報(言語/FW/ツール等のバージョンなど)
CAKEPHP3.5
Apache/2.4.25 (Amazon) OpenSSL/1.0.1k-fips PHP/7.0.16
PHP 拡張: mysqliドキュメント curlドキュメント mbstringドキュメント
PHP のバージョン: 7.0.16
サーバ: Localhost via UNIX socket
サーバの種類: MySQL
サーバのバージョン: 5.6.36-log - MySQL Community Server (GPL)
あなたの回答
tips
プレビュー