HybridAuth
HybridAuth enable developers to easily build social applications to engage websites vistors and customers on a social level by implementing social signin, social sharing, users profiles, friends list, activities stream, status updates and more.
HybridAuth goal is to act as an abstract api between your application and various social apis and identities providers such as Facebook, Twitter and Google.
HybridAuth has 30+ providers and 20+ plugins/add-ons. Its also downloaded 800k until now.
Usage
Install HybridAuth
composer install hybridauth/hybridauth
The authenticate() method redirects you to steemconnect service to get access_token if user doesnt have one already.
<?php
require_once 'vendor/autoload.php';
$config = [
'callback' => 'http://myawesomeapp.com/redirect/steemconnect',
'keys' => [ 'id' => 'fornaxstudio', 'secret' => 'top_secret']
];
try {
$steem = new Hybridauth\Provider\SteemConnect($config);
$steem->authenticate();
$userProfile = $steem->getUserProfile();
print_r($userProfile);
}
catch(\Exception $e){
echo 'Oops, we ran into an issue! ' . $e->getMessage();
}
Hint: by default, secret is mandatory on hybridauth for some other providers. You may pass it a string.
The redirected page;
After user gives permission, it will redirect you to;
http://myawesomeapp.com/redirect/steemconnect?access_token=USERSACCESSTOKEN
Apply your logic here :)
Check the hybridauth documentation.
PR Url;
https://github.com/hybridauth/hybridauth/pull/917
Proof of Work
Posted on Utopian.io - Rewarding Open Source Contributors