Which would be right service to use in PHP client library for Google to get basic info like name and email address?

喜欢而已 提交于 2019-12-25 01:23:35

问题


I am following this tutorial from last year, which teaches how to use Login with google for your website and get basic user info. In tutorial they are using Google_Oauth2Service class, which I could not find in PHP client library I downloaded.

There is a similar service named oAuth2 but it seems to require Google+ account. I do not want to use Google+ service.


回答1:


The easiest thing to use is the Plus API, with the people.get function: https://developers.google.com/+/api/latest/people/get. The function will work for all users as long as you request the profile scope - they don't have to have Google+ profiles or have granted the https://www.googleapis.com/auth/plus.login scope.



来源:https://stackoverflow.com/questions/29616741/which-would-be-right-service-to-use-in-php-client-library-for-google-to-get-basi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!