本文整理汇总了PHP中OAuthServer::requestToken方法的典型用法代码示例。如果您正苦于以下问题:PHP OAuthServer::requestToken方法的具体用法?PHP OAuthServer::requestToken怎么用?PHP OAuthServer::requestToken使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OAuthServer
的用法示例。
在下文中一共展示了OAuthServer::requestToken方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: request_token_action
/**
*
**/
public function request_token_action()
{
try {
$server = new OAuthServer();
$token = $server->requestToken();
$this->render_nothing();
} catch (Exception $e) {
$this->render_text($e->getMessage());
}
}
示例2: OAuthServer
/*
* Always announce XRDS OAuth discovery
*/
header('X-XRDS-Location: ' . get_config('wwwroot') . 'webservice/oauthv1/services.xrds');
/*
* Initialize OAuth store
*/
require_once get_config('docroot') . 'webservice/libs/oauth-php/OAuthServer.php';
require_once get_config('docroot') . 'webservice/libs/oauth-php/OAuthStore.php';
OAuthStore::instance('Mahara');
global $server;
$server = new OAuthServer();
!isset($_SERVER['PATH_INFO']) && ($_SERVER['PATH_INFO'] = null);
// Now - what kind of OAuth interaction are we handling?
if ($_SERVER['PATH_INFO'] == '/request_token') {
$server->requestToken();
exit;
} else {
if ($_SERVER['PATH_INFO'] == '/access_token') {
$server->accessToken();
exit;
} else {
if ($_SERVER['PATH_INFO'] == '/authorize') {
# logon
require_once 'pieforms/pieform.php';
if (!$USER->is_logged_in()) {
$form = new Pieform(auth_get_login_form());
auth_draw_login_page(null, $form);
exit;
}
$rs = null;
示例3: actionRequest_token
public function actionRequest_token()
{
$server = new OAuthServer();
$token = $server->requestToken();
exit;
}
示例4: requesttoken
private function requesttoken()
{
Neuron_Auth_OAuthStore::getStore();
$server = new OAuthServer();
$token = $server->requestToken();
}
示例5: executeRequestToken
public function executeRequestToken(sfWebRequest $request)
{
$store = $this->getStore();
$server = new OAuthServer();
try {
$server->requestToken();
sfContext::getInstance()->getLogger()->info("Got request token ");
die;
} catch (OAuthException $e) {
sfContext::getInstance()->getLogger()->err("Request token: OAuth Execption: " . $e->getMessage());
} catch (Exception $e) {
sfContext::getInstance()->getLogger()->err("Request token error: " . $e->getMessage());
}
}
示例6: requesttokenAction
public function requesttokenAction()
{
$server = new OAuthServer();
$token = $server->requestToken();
exit;
}