如果
不推荐使用https://www.googleapis.com/auth/userinfo.profile范围,如何使用最新版本的 google Oauth 2.0 打印 UserInfo
" google-api-php-client/src/contrib/Google_Oauth2Service.php " 文件夹不存在了
我想打印用户名,电子邮件...
我怎样才能做到这一点 ?
如果
不推荐使用https://www.googleapis.com/auth/userinfo.profile范围,如何使用最新版本的 google Oauth 2.0 打印 UserInfo
" google-api-php-client/src/contrib/Google_Oauth2Service.php " 文件夹不存在了
我想打印用户名,电子邮件...
我怎样才能做到这一点 ?
https://www.googleapis.com/auth/userinfo.profile
范围已替换为范围,profile
因此您的客户应请求后者。
我找到了解决方案:用用户信息替换范围,例如 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");
它有效!