bencagri avatar

SteemConnect provider for HybridAuth

bencagri

Published: 16 Feb 2018 › Updated: 16 Feb 2018SteemConnect provider for HybridAuth

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;

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

Leave SteemConnect provider for HybridAuth to:

Written by

Back-end developer

Read more #utopian-io posts


Best Posts From bencagri

We have not curated any of bencagri's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From bencagri