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

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

    <tfoot id='33hpk'></tfoot>

    1. <small id='33hpk'></small><noframes id='33hpk'>

      • <bdo id='33hpk'></bdo><ul id='33hpk'></ul>

        <legend id='33hpk'><style id='33hpk'><dir id='33hpk'><q id='33hpk'></q></dir></style></legend>

        使用服務帳戶,getAccessToken() 返回 null

        Using a Service Account, getAccessToken() is returning null(使用服務帳戶,getAccessToken() 返回 null)
          • <small id='Avn8u'></small><noframes id='Avn8u'>

                  <tbody id='Avn8u'></tbody>

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

                • <bdo id='Avn8u'></bdo><ul id='Avn8u'></ul>
                  本文介紹了使用服務帳戶,getAccessToken() 返回 null的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在運行以下 PHP 代碼,使用此處找到的客戶端庫:https://code.google.com/p/google-api-php-client/.我沒有收到任何此代碼的錯誤,但是當我調用 getAccessToken() 時,它返回 null.

                  I am running the following PHP code, using the client libraries found here: https://code.google.com/p/google-api-php-client/. I do not get any errors for any of this code, but when I call getAccessToken(), it returns null.

                  我已允許在我的個人日歷上訪問此服務帳戶,并已通過 API 控制臺授予對項目的完全訪問權限.

                  I have allowed access to this service account on my personal calendar, and have granted full access to the project via the API Console.

                  有什么想法嗎?

                  require_once 'google-api-php-client/src/Google_Client.php';
                  
                  const CLIENT_ID = 'blahblahblah';
                  const SERVICE_ACCOUNT_NAME = 'blahblahblah@developer.gserviceaccount.com';
                  const KEY_FILE = 'path/to/privatekey.p12';
                  
                  $google_client = new Google_Client(); // created only to initialized static dependencies
                  $client = new Google_OAuth2(); // you really just need Google_OAuth2
                  
                  $key = file_get_contents(KEY_FILE);  
                  
                  $client->setAssertionCredentials(
                      new Google_AssertionCredentials(
                          SERVICE_ACCOUNT_NAME,
                          array('https://www.googleapis.com/auth/calendar'),
                          $key
                      )
                  );
                  
                  var_dump($client->getAccessToken());
                  

                  推薦答案

                  出于某種原因,這似乎有效:

                  For some reason, this seemed to work:

                  require_once 'google-api-php-client/src/Google_Client.php';
                  
                  const CLIENT_ID = 'blahblahblah';
                  const SERVICE_ACCOUNT_NAME = 'blahblahblah@developer.gserviceaccount.com';
                  const KEY_FILE = 'path/to/privatekey.p12';
                  const CALENDAR_SCOPE = "https://www.googleapis.com/auth/calendar";
                  
                  $key = file_get_contents(KEY_FILE);
                  $auth = new Google_AssertionCredentials(
                      SERVICE_ACCOUNT_NAME,
                      array(CALENDAR_SCOPE),
                      $key
                  );
                  
                  $client = new Google_Client();
                  $client->setScopes(array(CALENDAR_SCOPE));
                  $client->setAssertionCredentials($auth);
                  $client->getAuth()->refreshTokenWithAssertion();
                  $accessToken = $client->getAccessToken();
                  
                  $client->setClientId(CLIENT_ID);
                  

                  如果有人可以解釋為什么這是有效的,請編輯此答案或評論!

                  If someone can explain why this worked, please edit this answer or comment!

                  這篇關于使用服務帳戶,getAccessToken() 返回 null的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 找不到驅動程序)
                  <tfoot id='FrAao'></tfoot>
                • <legend id='FrAao'><style id='FrAao'><dir id='FrAao'><q id='FrAao'></q></dir></style></legend>

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

                      <tbody id='FrAao'></tbody>

                            <bdo id='FrAao'></bdo><ul id='FrAao'></ul>

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

                            主站蜘蛛池模板: 午夜免费视频 | 中文字幕日韩一区 | 国产剧情一区二区三区 | 欧美精品久久 | 水蜜桃久久夜色精品一区 | 欧美日韩在线免费观看 | 久久精品一区二区三区四区 | 成人午夜在线 | 国产不卡一区在线观看 | 日本精品一区二区 | 日本国产精品视频 | 97精品超碰一区二区三区 | 视频一二三区 | 久久国产日韩 | 亚洲精品一区在线观看 | 国产黄色在线 | 国产成人影院 | 日本在线播放一区二区 | 精品国产乱码久久久久久闺蜜 | 日韩高清中文字幕 | 老司机深夜福利网站 | 一级片免费网站 | 福利视频大全 | 久久99精品久久久久久琪琪 | 亚洲一区二区三区久久 | www国产精品 | 一道本不卡 | 青青草免费在线视频 | 99热精品久久 | 国产精品欧美日韩 | 精品欧美一区二区三区久久久小说 | 日韩在线视频免费观看 | 免费的黄色片子 | a级免费视频 | 中文字幕在线免费视频 | 成人午夜免费视频 | 天堂av中文 | 美女日批免费视频 | 国产亚洲一区二区三区 | 欧美在线观看免费观看视频 | 麻豆久久久 |