7 return rtrim( fgets( STDIN ),
"\n" );
14 $baseDir = dirname(dirname(dirname(dirname(__FILE__))));
17 require_once(
$baseDir .
'/lib/_autoload.php');
20 require_once(dirname(dirname(__FILE__)) .
'/libextinc/OAuth.php');
29 echo
'Welcome to the OAuth CLI client' .
"\n";
34 echo
"Got a request token from the OAuth service provider [" .
$requestToken->key .
"] with the secret [" .
$requestToken->secret .
"]\n";
39 echo(
'Go to this URL to authenticate/authorize the request: ' .
$url .
"\n");
40 system(
'open ' .
$url);
42 _readline(
'Click enter when you have completed the authorization step using your web browser...');
46 echo
"Got an access token from the OAuth service provider [" .
$accessToken->key .
"] with the secret [" .
$accessToken->secret .
"]\n";
51 echo
'You are successfully authenticated to this Command Line CLI. ' .
"\n";
52 echo
'Got data [' . join(
', ', array_keys(
$userdata)) .
']' .
"\n";
53 echo
'Your user ID is : ' .
$userdata[
'eduPersonPrincipalName'][0] .
"\n";
56 echo
'Error occurred: ' . $e->getMessage() .
"\n\n";
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
static getSessionFromRequest()
Retrieves the current session.