如何使用Google Oauth2.0在Php中打印UserInfo
How can I print UserInfo with the latest version of google Oauth 2.0
if
https://www.googleapis.com/auth/userinfo.profile scope is deprecated
"google-api-php-client/src/contrib/Google_Oauth2Service.php" Folder doesn't exist anymore
I want to print username, email ...
How can I do this ?
如果 https://www.googleapis.com/auth/userinfo.profile 范围 p>
“ google-api-php-client / src / contrib / Google_Oauth2Service.php strong>”文件夹不再存在 p>
我要打印 用户名,电子邮件...... p>
我该怎么做? p>
div>
I found the solution : replace scopes with Userinfo like https://www.googleapis.com/auth/userinfo.profile
with that :
$client->addScope("https://www.googleapis.com/auth/plus.login");
$client->addScope("https://www.googleapis.com/auth/plus.profile.emails.read");
And It Works !
The https://www.googleapis.com/auth/userinfo.profile
scope was replaced with the profile
scope so your client should request the latter.