Skip to content

Instantly share code, notes, and snippets.

@kayalshri
Last active December 15, 2015 11:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kayalshri/5253935 to your computer and use it in GitHub Desktop.
Save kayalshri/5253935 to your computer and use it in GitHub Desktop.
Bitly oauth php connect authentication
<?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