0


如果 不推荐使用https://www.googleapis.com/auth/userinfo.profile范围,如何使用最新版本的 google Oauth 2.0 打印 UserInfo

" google-api-php-client/src/contrib/Google_Oauth2Service.php " 文件夹不存在了

我想打印用户名,电子邮件...

我怎样才能做到这一点 ?

4

2 回答 2

0

https://www.googleapis.com/auth/userinfo.profile范围已替换为范围,profile因此您的客户应请求后者。

于 2014-12-29T09:10:59.250 回答
0

我找到了解决方案:用用户信息替换范围,例如 https://www.googleapis.com/auth/userinfo.profile

接着就,随即 :

$client->addScope("https://www.googleapis.com/auth/plus.login"); $client->addScope("https://www.googleapis.com/auth/plus.profile.emails.read");

它有效!

于 2014-12-30T18:56:03.467 回答