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. Who is used to on this plugin?
Please help me.
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. Who is used to on this plugin?
Please help me.
First of all, I must thank my friend for helping me solve this mystery in cakephp 3.
I'm providing the complete options how to use the plugin in cakephp 3 may this give a solution and explore more improvements in that plugin.
Step 1: Run in composer
This must install plugin in the following path,
Step 2: Initialize the plugin.
A. Modify the config.php file in the following folder,
to the required method, like add the app id and secret id, etc.
Step 3: Now in yours users controller, (I have used users controller for http://localhost/your-app-folder/users/social - for my needs)
Now your controller should look like this,
Note: Modify The Things according to your needs and design the table as per you requirement.
Step 4
Calling the hybrid auth:
for facebook login;
Eureka. It will works like a charm.
For more info comment here.
Edit 2:
Example Login Action (Default Auth Control)
In App Controller,
i got error with these code and i repaired it with: error: Hybriauth config does not exist on the given path.
solution: in users controller where you call(require) config.php
you need to store that what you require in variable $config:
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:
and
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: