I am getting an interesting SDK exception message from FB\'s PHP SDK. I set up my code exactly as the FB docs say to do..?
DEBUG ERROR MESSAGE:
[12-J
For using CakePHP v3.1.6 + Facebook SDK v4.1.
In the newer SDK, \Facebook\FacebookRedirectLoginHelper class has been changed to use \Facebook\FacebookSessionPersistentDataHandler class to handle session "state". Putting $this->request->session()->start() in AppController initialize will fix the problem using Facebook SDK with AuthComponent.
public function initialize() {
parent::initialize();
$this->request->session()->start();
$this->loadComponent('RequestHandler');
$this->loadComponent('Flash');
$this->loadComponent('Auth', [
'authenticate' => [
'Form' => [
'fields' => ['username' => 'email', 'password' => 'password']
]
],
'loginAction' => ['controller' => 'Users', 'action' => 'login']
]);
}