SteemConnect provider for HybridAuth
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
Thank you for the contribution. It has been approved.
You can contact us on Discord.
[utopian-moderator]
HybridAuth with SteemConnect! This is huge step forward.
I will use that in mine PHP projects. Thanks!
You are welcome :)
Hey @bencagri I am @utopian-io. I have just upvoted you!
Achievements
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x