seocom / social_login
Installs: 146
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 1
Open Issues: 0
Type:cakephp-plugin
Requires
- composer/installers: *
- opauth/google: 1.0.*@dev
- opauth/opauth: 1.0.*@dev
This package is not auto-updated.
Last update: 2016-02-11 11:05:45 UTC
README
A CakePHP plugin built to facilitate the Opauth 1.0 functionality.
Installation of Plugin
Insert the following in your Config/bootstrap.php file:
CakePlugin::load(['SocialLogin' => ['routes' => true]]); Configure::write('Opauth', [ 'Strategy' => [ 'Twitter' => [ 'key' => 'twitter_key', 'secret' => 'twitter_secret' ], 'Facebook' => [ 'app_id' => 'facebook_app_id', 'app_secret' => 'facebook_app_secret' ], 'Google' => [ 'client_id' => 'google_client_id', 'client_secret' => 'google_client_secret' ], 'LinkedIn' => [ 'api_key' => 'linkedin_api_key', 'secret_key' => 'linkedin_secret_key' ], ], 'path' => '/login/', 'redirect' => '/where-to-redirect-after-login' ]);
Then run: composer install/update
Testing
If you want to authorize your app with Google, first create your Google app.
Next, add your client_id
and client_secret
in your config array (see above).
Finally, browse to yourapp.com/login/google
. The app should prompt you to authorize through your Google account, and then redirect you to the page you specified in your config array.