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