本文整理汇总了PHP中OAuthServer::accessToken方法的典型用法代码示例。如果您正苦于以下问题:PHP OAuthServer::accessToken方法的具体用法?PHP OAuthServer::accessToken怎么用?PHP OAuthServer::accessToken使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OAuthServer
的用法示例。
在下文中一共展示了OAuthServer::accessToken方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionAccess_token
public function actionAccess_token()
{
$server = new OAuthServer();
/* ----------------------------------------------------------------- */
$x_auth_mode = $this->module->getParam('x_auth_mode');
if ($x_auth_mode == 'client_auth') {
$username = $this->module->getParam('x_auth_username');
$password = $this->module->getParam('x_auth_password');
$model = new LoginForm();
$arr = array('username' => $username, 'password' => $password);
$model->attributes = $arr;
if ($model->validate() && $model->login()) {
$user_id = Yii::app()->user->id;
$result = $server->xauthAccessToken($user_id);
echo $result;
exit;
}
}
/* ----------------------------------------------------------------- */
$server->accessToken();
exit;
}
示例2: OAuthServer
/*
* 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;
try {
$rs = $server->authorizeVerify();
} catch (OAuthException2 $e) {
header('HTTP/1.1 400 Bad Request');
示例3: access_token_action
/**
*
**/
public function access_token_action()
{
$server = new OAuthServer();
$server->accessToken();
$this->render_nothing();
}
示例4: accesstoken
private function accesstoken()
{
Neuron_Auth_OAuthStore::getStore();
$server = new OAuthServer();
$token = $server->accessToken();
}
示例5: executeAccessToken
public function executeAccessToken(sfWebRequest $request)
{
$store = $this->getStore();
$server = new OAuthServer();
try {
$server->accessToken();
sfContext::getInstance()->getLogger()->info("Got access token ");
die;
} catch (OAuthException $e) {
sfContext::getInstance()->getLogger()->err("Access token: OAuth Execption: " . $e->getMessage());
} catch (Exception $e) {
sfContext::getInstance()->getLogger()->err("Access token error: " . $e->getMessage());
}
}
示例6: accesstokenAction
public function accesstokenAction()
{
$server = new OAuthServer();
$server->accessToken();
exit;
}