diff --git a/examples/php/live/authentication/common.php b/examples/php/live/authentication/common.php new file mode 100644 index 00000000..05873f77 --- /dev/null +++ b/examples/php/live/authentication/common.php @@ -0,0 +1,19 @@ +getAccessToken(constant('ACCESS_TOKEN')); + + $_SESSION['accessToken'] = $consumer->getToken(); + $_SESSION['accessTokenSecret'] = $consumer->getTokenSecret(); + + header('Location:index.php'); +} catch (Exception $e) { + ?> +
Authorization failed!
+ + getRequestToken(constant('REQUEST_TOKEN'), constant('BASE_URL').'/getAccessToken.php'); + +$_SESSION['token'] = $consumer->getToken(); +$_SESSION['tokenSecret'] = $consumer->getTokenSecret(); + +$url = $consumer->getAuthorizeUrl(constant('AUTHORIZE_TOKEN')); +header('Location:'.$url); diff --git a/examples/php/live/authentication/index.php b/examples/php/live/authentication/index.php new file mode 100644 index 00000000..a0a78db9 --- /dev/null +++ b/examples/php/live/authentication/index.php @@ -0,0 +1,47 @@ +We have no access token, connect us +We have access!
+
+ In your system, store these values to do requests for this user:
+ Token:
+ Secret:
+
'; + echo( htmlentities($response->getBody())); +} + +?>sendRequest(constant('REQUEST_URI').'/clients/list', $params, 'GET'); + echo ''; + echo( htmlentities($response->getBody())); +} + +