SteemConnect provider for HybridAuth

in #utopian-io7 years ago (edited)

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;

Screen Shot 2018-02-16 at 4.54.30 PM.png

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

Screen Shot 2018-02-16 at 4.45.08 PM.png



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

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

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

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

Coin Marketplace

STEEM 0.19
TRX 0.15
JST 0.029
BTC 63550.59
ETH 2644.53
USDT 1.00
SBD 2.81