Last active
December 15, 2015 11:38
-
-
Save kayalshri/5253935 to your computer and use it in GitHub Desktop.
Bitly oauth php connect authentication
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include "socialmedia_oauth_connect.php"; | |
$oauth = new socialmedia_oauth_connect(); | |
$oauth->provider="Bitly"; | |
$oauth->client_id = "4cfed21a38e6b8e25f5da9b74bfad075710e96d4"; | |
$oauth->client_secret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; | |
$oauth->redirect_uri ="http://ngiriraj.com/socialMedia/oauthlogin/bitly.php"; | |
$oauth->Initialize(); | |
$code = ($_REQUEST["code"]) ? ($_REQUEST["code"]) : ""; | |
if(empty($code)) { | |
$oauth->Authorize(); | |
}else{ | |
$oauth->code = $code; | |
# $oauth->getAccessToken(); | |
$getData = json_decode($oauth->getUserProfile()); | |
$oauth->debugJson($getData); | |
print "Name :".$getData->data->full_name; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment