Connect your application(s) with social network(s).
See example.
- OAuth1
- OAuth2
- OpenID (WIP!)
- GitHub
- Vk (ВКонтакте)
- PayPal (WIP!)
First you need to setup service:
$service = new \SocialConnect\Auth\Service(array(
'redirectUri' => 'http://sconnect.local/auth/cb',
'provider' => array(
'Facebook' => array(
'applicationId' => '',
'applicationSecret' => '',
'scope' => array('email')
),
)
));
$service->setHttpClient(new \SocialConnect\Common\Http\Client\Curl());
Next create you loginAction:
$providerName = 'facebook';
$provider = $service->getProvider($providerName);
header('Location: ' . $provider->makeAuthUrl());
And implement callback handler:
$providerName = 'facebook';
$provider = $service->getProvider($providerName);
$accessToken = $provider->getAccessTokenByRequestParameters($_GET);
var_dump($accessToken);
$user = $provider->getIdentity($accessToken);
var_dump($user);
This project is open-sourced software licensed under the MIT License.
See the LICENSE file for more information.