pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

<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="yemgccc" 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="ywmw6go" 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"的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我開始在我的新應用程序上配置谷歌日歷.我幾乎制作了谷歌開發者展示的身份驗證代碼的精確副本(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 的控制臺上正確設置了重定向 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);
                      }
                  }
                  
                  ?>
                  

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

                  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
                  

                  推薦答案

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

                  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.

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

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

                  相關文檔推薦

                  Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                  PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動游標不起作用)
                  PHP PDO ODBC connection(PHP PDO ODBC 連接)
                  Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術方法)
                  php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個值;等于變量的值)
                  MSSQL PDO could not find driver(MSSQL PDO 找不到驅動程序)
                  <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="emmgucq" id='fMhuk'><tfoot id='fMhuk'></tfoot><dl id='fMhuk'><fieldset id='fMhuk'></fieldset></dl></div>
                            主站蜘蛛池模板: 磁力抛光机_磁力研磨机_磁力去毛刺机-冠古设备厂家|维修|租赁【官网】 | NMRV减速机|铝合金减速机|蜗轮蜗杆减速机|NMRV减速机厂家-东莞市台机减速机有限公司 | LCD3D打印机|教育|桌面|光固化|FDM3D打印机|3D打印设备-广州造维科技有限公司 | 耐腐蚀泵,耐腐蚀真空泵,玻璃钢真空泵-淄博华舜耐腐蚀真空泵有限公司 | 陕西安玻璃自动感应门-自动重叠门-磁悬浮平开门厂家【捷申达门业】 | 注浆压力变送器-高温熔体传感器-矿用压力传感器|ZHYQ朝辉 | 西门子代理商_西门子变频器总代理-翰粤百科 | 上海单片机培训|重庆曙海培训分支机构—CortexM3+uC/OS培训班,北京linux培训,Windows驱动开发培训|上海IC版图设计,西安linux培训,北京汽车电子EMC培训,ARM培训,MTK培训,Android培训 | 哈尔滨京科脑康神经内科医院-哈尔滨治疗头痛医院-哈尔滨治疗癫痫康复医院 | 防爆正压柜厂家_防爆配电箱_防爆控制箱_防爆空调_-盛通防爆 | 首页|成都尚玖保洁_家政保洁_开荒保洁_成都保洁 | 全自动过滤器_反冲洗过滤器_自清洗过滤器_量子除垢环_量子环除垢_量子除垢 - 安士睿(北京)过滤设备有限公司 | 深圳高新投三江工业消防解决方案提供厂家_服务商_园区智慧消防_储能消防解决方案服务商_高新投三江 | 智能风向风速仪,风速告警仪,数字温湿仪,综合气象仪(气象五要素)-上海风云气象仪器有限公司 | 培训一点通 - 合肥驾校 - 合肥新亚驾校 - 合肥八一驾校 | 济南网站策划设计_自适应网站制作_H5企业网站搭建_济南外贸网站制作公司_锐尚 | 淘剧影院_海量最新电视剧,免费高清电影随心观看 | 车间除尘设备,VOCs废气处理,工业涂装流水线,伸缩式喷漆房,自动喷砂房,沸石转轮浓缩吸附,机器人喷粉线-山东创杰智慧 | 上海软件开发-上海软件公司-软件外包-企业软件定制开发公司-咏熠科技 | 太空舱_民宿太空舱厂家_移动房屋太空舱价格-豪品建筑 | 锥形螺带干燥机(新型耙式干燥机)百科-常州丰能干燥工程 | 云南标线|昆明划线|道路标线|交通标线-就选云南云路施工公司-云南云路科技有限公司 | 济南冷库安装-山东冷库设计|建造|冷库维修-山东齐雪制冷设备有限公司 | 英国雷迪地下管线探测仪-雷迪RD8100管线仪-多功能数字听漏仪-北京迪瑞进创科技有限公司 | LED投光灯-工矿灯-led路灯头-工业灯具 - 山东普瑞斯照明科技有限公司 | 新能源汽车电机定转子合装机 - 电机维修设备 - 睿望达 | 章丘丰源机械有限公司 - 三叶罗茨风机,罗茨鼓风机,罗茨风机 | 国际船舶网 - 船厂、船舶、造船、船舶设备、航运及海洋工程等相关行业综合信息平台 | 北京网站建设|北京网站开发|北京网站设计|高端做网站公司 | 伊卡洛斯软装首页-电动窗帘,别墅窗帘,定制窗帘,江浙沪1000+别墅窗帘案例 | PC构件-PC预制构件-构件设计-建筑预制构件-PC构件厂-锦萧新材料科技(浙江)股份有限公司 | 板式换热器_板式换热器价格_管式换热器厂家-青岛康景辉 | 扒渣机,铁水扒渣机,钢水扒渣机,铁水捞渣机,钢水捞渣机-烟台盛利达工程技术有限公司 | 包装设计公司,产品包装设计|包装制作,包装盒定制厂家-汇包装【官方网站】 | 武汉EPS线条_EPS装饰线条_EPS构件_湖北博欧EPS线条厂家 | 碳钢法兰厂家,非标法兰,定制异型,法兰生产厂家-河北九瑞管道 | 卡诺亚轻高定官网_卧室系统_整家定制_定制家居_高端定制_全屋定制加盟_定制家具加盟_定制衣柜加盟 | 合肥宠物店装修_合肥宠物美容院装修_合肥宠物医院设计装修公司-安徽盛世和居装饰 | 全自动过滤器_反冲洗过滤器_自清洗过滤器_量子除垢环_量子环除垢_量子除垢 - 安士睿(北京)过滤设备有限公司 | 贵州科比特-防雷公司厂家提供贵州防雷工程,防雷检测,防雷接地,防雷设备价格,防雷产品报价服务-贵州防雷检测公司 | 升降机-高空作业车租赁-蜘蛛车-曲臂式伸缩臂剪叉式液压升降平台-脚手架-【普雷斯特公司厂家】 |