Skip to content

Instantly share code, notes, and snippets.

@kayalshri
Created March 27, 2013 12:08
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/5253725 to your computer and use it in GitHub Desktop.
Save kayalshri/5253725 to your computer and use it in GitHub Desktop.
Box oauth php authentication
<?php
include "socialmedia_oauth_connect.php";
$oauth = new socialmedia_oauth_connect();
$oauth->provider="Box";
$oauth->client_id = "l7r9q1aslzc5hmwrikgyzqqngzc8ef0i";
$oauth->client_secret = "xxxxxxxxxxxxxxxxxxxxxxxxxx";
$oauth->scope="";
$oauth->redirect_uri ="https://silver.nseasy.com/~ngiriraj/socialMedia/oauthlogin/box.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);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment