I use CakePHP 3.x to create a page can make a social sign in. I found HybridAuth plugin can do that. But, I can\'t understand about configuration and flow.
Have you read this page yet? http://miftyisbored.com/complete-social-login-application-tutorial-cakephp-2-3-twitter-facebook-google/
This would help you to put hybridauth into CakePHP 3.0, but you need to change some points in CakePHP3 way, like:
// config/hybridauth.php
return [
'HybridAuth' => [
'base_url' => 'URL here',
'providers' => [
'Twitter' => [...]
]
];
and
// src/Controller/Component/HybridauthComponent.php
// App::import('Vendor', 'hybridauth/Hybrid/Auth');
// $this->hybridauth = new Hybrid_Auth( $config );
$this->hybridauth = new \Hybrid_Auth( $config );
In addition, check this document.
https://github.com/ADmad/CakePHP-HybridAuth/blob/master/README.md
It says you need to initialize the Auth component, but it didn't work this way, so I put these options like this:
// src/Controller/AppController.php
public function initialize()
{
$this->loadComponent('Auth', [
'authenticate' => [
'ADmad/HybridAuth.HybridAuth'
],
// redirect here if the user not authorized
'loginAction' => [
'controller' => 'User',
'action' => 'login',
],
]);
}