当前位置: 首页>>代码示例>>PHP>>正文


PHP OAuthServer::accessToken方法代码示例

本文整理汇总了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;
 }
开发者ID:vangogogo,项目名称:justsns,代码行数:22,代码来源:OauthController.php

示例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');
开发者ID:vohung96,项目名称:mahara,代码行数:31,代码来源:oauthv1.php

示例3: access_token_action

 /**
  *
  **/
 public function access_token_action()
 {
     $server = new OAuthServer();
     $server->accessToken();
     $this->render_nothing();
 }
开发者ID:ratbird,项目名称:hope,代码行数:9,代码来源:oauth.php

示例4: accesstoken

 private function accesstoken()
 {
     Neuron_Auth_OAuthStore::getStore();
     $server = new OAuthServer();
     $token = $server->accessToken();
 }
开发者ID:catlabinteractive,项目名称:dolumar-engine,代码行数:6,代码来源:OAuth.php

示例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());
     }
 }
开发者ID:voota,项目名称:voota,代码行数:14,代码来源:BaseSfOauthServerActions.class.php

示例6: accesstokenAction

 public function accesstokenAction()
 {
     $server = new OAuthServer();
     $server->accessToken();
     exit;
 }
开发者ID:henvic,项目名称:MediaLab,代码行数:6,代码来源:OauthController.php


注:本文中的OAuthServer::accessToken方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。