Open source social sign on PHP. Connect your application(s) with social network(s).
See example.
If I didn't see your issue, PR please ping me direct by Telegram!
- OAuth1 spec RFC 5849
- OAuth2 spec RFC 6749
- OpenID v1 (1.1) (WIP!) spec
- OpenID v2 spec
- OpenID Connect (1.0) spec
- JWT (JSON Web Token) spec RFC 7519
- JWK (JSON Web Keys) spec RFC 7517
- PayPal (WIP!)
- Steam
- 500px
- Tumblr
- Amazon
- Vk (ВКонтакте)
- GitHub
- GitLab
- Slack
- BitBucket
- Twitch
- Vimeo
- DigitalOcean
- Yandex
- MailRu
- Odnoklassniki
- Google (you can use Google from
OAuth2
orOpenIDConnect
)
The recommended way to install socialconnect/auth
is via Composer.
- If you do not have composer installed, download the
composer.phar
executable or use the installer.
$ curl -sS https://getcomposer.org/installer | php
- Run
php composer.phar require socialconnect/auth
or add a new requirement in your composer.json.
{
"require": {
"socialconnect/auth": "~1.0.0"
}
}
- Run
php composer.phar update
Composer:
composer install
First you need to setup SocialConnect\Auth\Service
:
$configuration = [
'redirectUri' => 'http://sconnect.local/auth/cb',
'provider' => [
'facebook' => [
'applicationId' => '',
'applicationSecret' => '',
'scope' => [
'email'
]
],
]
];
$service = new \SocialConnect\Auth\Service(
new \SocialConnect\Common\Http\Client\Curl(),
new \SocialConnect\Provider\Session\Session(),
$configuration
);
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.