久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<small id='zgRZo'></small><noframes id='zgRZo'>

  • <legend id='zgRZo'><style id='zgRZo'><dir id='zgRZo'><q id='zgRZo'></q></dir></style></legend>

    1. <tfoot id='zgRZo'></tfoot>
        <bdo id='zgRZo'></bdo><ul id='zgRZo'></ul>
      <i id='zgRZo'><tr id='zgRZo'><dt id='zgRZo'><q id='zgRZo'><span id='zgRZo'><b id='zgRZo'><form id='zgRZo'><ins id='zgRZo'></ins><ul id='zgRZo'></ul><sub id='zgRZo'></sub></form><legend id='zgRZo'></legend><bdo id='zgRZo'><pre id='zgRZo'><center id='zgRZo'></center></pre></bdo></b><th id='zgRZo'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='zgRZo'><tfoot id='zgRZo'></tfoot><dl id='zgRZo'><fieldset id='zgRZo'></fieldset></dl></div>

      1. 谷歌身份驗證:OAuth2 不斷返回“invalid_grant"

        Authentication on google: OAuth2 keeps returning #39;invalid_grant#39;(谷歌身份驗證:OAuth2 不斷返回“invalid_grant)
      2. <tfoot id='pBm13'></tfoot>
              <bdo id='pBm13'></bdo><ul id='pBm13'></ul>

            • <legend id='pBm13'><style id='pBm13'><dir id='pBm13'><q id='pBm13'></q></dir></style></legend>

              <i id='pBm13'><tr id='pBm13'><dt id='pBm13'><q id='pBm13'><span id='pBm13'><b id='pBm13'><form id='pBm13'><ins id='pBm13'></ins><ul id='pBm13'></ul><sub id='pBm13'></sub></form><legend id='pBm13'></legend><bdo id='pBm13'><pre id='pBm13'><center id='pBm13'></center></pre></bdo></b><th id='pBm13'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='pBm13'><tfoot id='pBm13'></tfoot><dl id='pBm13'><fieldset id='pBm13'></fieldset></dl></div>
                <tbody id='pBm13'></tbody>

              1. <small id='pBm13'></small><noframes id='pBm13'>

                  本文介紹了谷歌身份驗證:OAuth2 不斷返回“invalid_grant"的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我開始在我的新應(yīng)用程序上配置谷歌日歷.我?guī)缀踔谱髁斯雀栝_發(fā)者展示的身份驗證代碼的精確副本(https://developers.google.com/google-apps/calendar/instantiate ),但我不斷收到以下錯誤:

                  I started to configure google calendar on my new application. I almost made an exact copy of the authentication code displayed at google developers ( https://developers.google.com/google-apps/calendar/instantiate ), but i keep getting the following error:

                  獲取 OAuth2 訪問令牌時出錯,消息:'invalid_grant'

                  Error fetching OAuth2 access token, message: 'invalid_grant'

                  我目前使用 Fork-CMS ( http://www.fork-cms.com),一個年輕的輕量級 CMS.我正確配置了 google-api-php-client 的 config.php 文件.(client-id, client-secret, redirect-uri, development key,...) 并且在 google api 的控制臺上正確設(shè)置了重定向 uri.我的代碼如下所示:

                  I'm currently using Fork-CMS ( http://www.fork-cms.com ), a young lightweigth CMS. I correctly configured the config.php file of the google-api-php-client. (client-id, client-secret, redirect-uri, development key,...) and the redirect uri is correctly set on the google api's console. My code looks as follows:

                  <?php
                  
                  /**
                  * This is a widget with a calendar implementation.
                  *
                  * @package       frontend
                  * @subpackage    events
                  *
                  * @author        Michiel Vlaminck <michielvlaminck@gmail.com>
                  */
                  class FrontendEventsWidgetCalendar extends FrontendBaseWidget
                  {
                  
                      private $events = array();
                      private $authUrl = array();
                  
                      /**
                      * Execute the extra
                      *
                      * @return    void
                      */
                      public function execute()
                      {      
                          // call parent
                          parent::execute();
                  
                          // load template
                          $this->loadTemplate();
                  
                          // get data
                          $this->getData();
                  
                          // parse
                          $this->parse();
                      }
                  
                  
                      /**
                      * Get the data from Google Calendar
                      * This method is only executed if the template isn't cached
                      *
                      * @return    void
                      */
                      private function getData()
                      {
                          require_once PATH_LIBRARY . '/external/google-api-php-client/src/apiClient.php';
                          require_once PATH_LIBRARY . '/external/google-api-php-client/src/contrib/apiCalendarService.php';
                  
                          $client = new apiClient();
                  
                          $service = new apiCalendarService($client);
                  
                          if (isset($_SESSION['oauth_access_token'])) {
                              $client->setAccessToken($_SESSION['oauth_access_token']);
                          } else {
                              $token = $client->authenticate();
                              $_SESSION['oauth_access_token'] = $token;
                          }
                  
                          if ($client->getAccessToken()) {
                  
                              $calId = FrontendEventsModel::getCalendarId((int) $this->data['id']);
                              $calId = $calId[0]['calendar_id'];
                  
                              $events = $service->events->listEvents($calId);
                              $this->events = $events['items'];
                  
                              $_SESSION['oauth_access_token'] = $client->getAccessToken();
                  
                          } else {
                              $this->authUrl = $client->createAuthUrl();
                          }
                      }
                  
                  
                      /**
                      * Parse
                      *
                      * @return    void
                      */
                      private function parse()
                      {
                          $this->tpl->assign('events', $this->events);
                          $this->tpl->assign('authUrl', $this->authUrl);
                      }
                  }
                  
                  ?>
                  

                  當(dāng)我第一次打開這個小部件頁面時,我被引導(dǎo)到谷歌來驗證應(yīng)用程序.當(dāng)我同意時,我被重定向到我的應(yīng)用程序,這就是我得到的點:

                  When I open this widget-page for the first time, I get directed to google to authenticate the application. When I agree, I get redirected to my application and that's the point where I'm getting:

                  apiAuthException ? Main
                  
                  Message Error fetching OAuth2 access token, message: 'invalid_grant'
                  File    C:wampwwwOfficevibeslibrary/externalgoogle-api-php-clientsrcauthapiOAuth2.php
                  Line    105
                  Date    Thu, 05 Apr 2012 08:34:47 +0000
                  URL http://localhost/calendar?code=4/YPUpFklKvhEeTcMm4moRth3x49oe
                  Referring URL   (Unknown)
                  Request Method  GET
                  User-agent  Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.142 Safari/535.19
                  

                  推薦答案

                  您應(yīng)該重復(fù)使用在第一次成功驗證后獲得的訪問令牌.如果您之前的令牌尚未過期,您將收到 invalid_grant 錯誤.將其緩存在某處,以便您可以重復(fù)使用.

                  You should reuse the access token you get after the first successful authentication. You will get an invalid_grant error if your previous token has not expired yet. Cache it somewhere so you can reuse it.

                  這篇關(guān)于谷歌身份驗證:OAuth2 不斷返回“invalid_grant"的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                  PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動游標(biāo)不起作用)
                  PHP PDO ODBC connection(PHP PDO ODBC 連接)
                  Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術(shù)方法)
                  php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個值;等于變量的值)
                  MSSQL PDO could not find driver(MSSQL PDO 找不到驅(qū)動程序)
                  <legend id='fMhuk'><style id='fMhuk'><dir id='fMhuk'><q id='fMhuk'></q></dir></style></legend>

                        <tbody id='fMhuk'></tbody>
                        <bdo id='fMhuk'></bdo><ul id='fMhuk'></ul>

                            <small id='fMhuk'></small><noframes id='fMhuk'>

                            <tfoot id='fMhuk'></tfoot>
                            <i id='fMhuk'><tr id='fMhuk'><dt id='fMhuk'><q id='fMhuk'><span id='fMhuk'><b id='fMhuk'><form id='fMhuk'><ins id='fMhuk'></ins><ul id='fMhuk'></ul><sub id='fMhuk'></sub></form><legend id='fMhuk'></legend><bdo id='fMhuk'><pre id='fMhuk'><center id='fMhuk'></center></pre></bdo></b><th id='fMhuk'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='fMhuk'><tfoot id='fMhuk'></tfoot><dl id='fMhuk'><fieldset id='fMhuk'></fieldset></dl></div>
                            主站蜘蛛池模板: 欧美精品中文 | 久久精品无码一区二区三区 | a级黄色片在线观看 | 麻豆精品国产免费 | 成人性视频在线播放 | 亚洲国产欧美91 | 91美女在线观看 | 国内精品久久久久久影视8 最新黄色在线观看 | 亚洲精品一区二区在线观看 | 久草视| 久久极品 | 欧美一二区 | 视频一区二区三区四区五区 | 日韩一区二区三区在线视频 | 国产成人av一区二区三区 | 亚洲精品字幕 | 欧美激情一区二区三区 | 亚洲精品一区中文字幕乱码 | 欧美日韩在线综合 | 国产精品久久久久久久久大全 | a网站在线观看 | 欧州一区二区三区 | 亚洲a在线观看 | 精品国产91 | 中文字幕亚洲视频 | 巨大荫蒂视频欧美另类大 | 成人做爰999 | 国产成人一区 | 在线播放中文字幕 | 伊人免费观看视频 | 亚洲精品国产成人 | 国产一区二区三区免费 | 国产高清视频一区 | 欧美在线a| 精品亚洲一区二区三区四区五区高 | 国产精品毛片久久久久久久 | 日韩最新网站 | 午夜精品久久久久久久久久久久 | av一区二区三区在线观看 | 成人在线观看亚洲 | 91麻豆精品一区二区三区 |