在Google的PHP客户端库中,哪种服务最适合用于Google以获得名称和电子邮件地址之类的基本信息? [英] Which would be right service to use in PHP client library for Google to get basic info like name and email address?

查看:125
本文介绍了在Google的PHP客户端库中,哪种服务最适合用于Google以获得名称和电子邮件地址之类的基本信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在关注去年的教程,该课程教您如何在您的网站上使用使用google登录"并获取基本的用户信息.在教程中,他们使用的是Google_Oauth2Service类,该类在 PHP客户端库中找不到我下载了.

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.

有一个名为oAuth2的类似服务,但它似乎需要Google+帐户.我不想使用Google+服务.

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

推荐答案

最容易使用的是Plus API,它具有people.get函数:

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.

这篇关于在Google的PHP客户端库中,哪种服务最适合用于Google以获得名称和电子邮件地址之类的基本信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆