socialmedia_oauth_connect::getUserProfile PHP Method

getUserProfile() public method

public getUserProfile ( )
    public function getUserProfile()
    {
        $getAccessToken_value = $this->getAccessToken();
        $getatoken = json_decode(stripslashes($getAccessToken_value));
        if ($getatoken === NULL) {
            $atoken = $getAccessToken_value;
        } else {
            $atoken = $getatoken->access_token;
        }
        if ($this->provider == "Yammer") {
            $atoken = $getatoken->access_token->token;
        }
        if ($this->userProfileUrl) {
            $profile_url = $this->userProfileUrl . "" . $atoken;
            #$_SESSION['atoken']=$atoken;
            #print "profile :".$profile_url;
            #exit();
            return $this->curl_request($profile_url, "GET", $atoken);
        } else {
            return $getAccessToken_value;
        }
    }

Usage Example

	@History		:	V1.0 - Released oauth 2.0 service providers login access	
	@oauth2		:	Support following oauth2 login
					Bitly
					Wordpress
					Paypal
					Facebook
					Google
					Microsoft(MSN,Live,Hotmail)
					Foursquare
					Box
					Reddit
					Yammer
					Yandex					
*/
include "socialmedia_oauth_connect.php";
$oauth = new socialmedia_oauth_connect();
$oauth->provider = "Facebook";
$oauth->client_id = "482962811753376";
$oauth->client_secret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
$oauth->scope = "email,publish_stream,status_update,friends_online_presence,user_birthday,user_location,user_work_history";
$oauth->redirect_uri = "http://ngiriraj.com/socialMedia/oauthlogin/facebook.php";
$oauth->Initialize();
$code = $_REQUEST["code"] ? $_REQUEST["code"] : "";
if (empty($code)) {
    $oauth->Authorize();
} else {
    $oauth->code = $code;
    #	print $oauth->getAccessToken();
    $getData = json_decode($oauth->getUserProfile());
    $oauth->debugJson($getData);
}
All Usage Examples Of socialmedia_oauth_connect::getUserProfile