0
我剛開始學習Google樹玩,我有一些問題。Google Drive OAuth2獲得令牌
如何使用登錄鏈接登錄?
session_start(); require_once 'api/src/Google/Client.php'; require_once 'api/src/Google/Service/Drive.php'; $drive = new Google_Client(); $drive->setClientId('XXXXXXXX-hc0ap9uujjvqpsci9ceitqsrro1d8415.apps.googleusercontent.com'); // Client ID $drive->setClientSecret('XXXXXXXXXXX'); //Client Secret $drive->setRedirectUri($url); $drive->setScopes(array('https://www.googleapis.com/auth/drive')); $url = $drive->createAuthUrl();
如何獲取access_token?
嘗試登錄時是否遇到任何異常?請認真描述。 – 2015-02-09 21:43:02
@Petr。在開始編碼之前,您確實需要閱讀並理解OAuth。 OAuth中沒有「登錄」。至少有三種不同的方法來獲取訪問令牌。閱讀並理解https://developers.google.com/accounts/docs/OAuth2 – pinoyyid 2015-02-10 03:36:43