【发布时间】:2015-02-07 12:46:21
【问题描述】:
我正在开发登录系统,用户使用 google plus api 登录到网站。我在令牌验证后点击“我”端点。但在某些情况下我遇到了一个问题,我没有得到用户的 displayName/Name 对象。 使用的范围:plus.profile 和 plus.login Endpint命中:“我”
$service=new Google_Service_Plus($client);
$userinfo=$service->people->get('me');
我想获取用户的用户名。
【问题讨论】:
-
是否与特定用户一致?你能用APIs Explorer 复制它吗?您确定您没有收到您未捕获的请求的错误吗?
-
@abraham:是的,我什至没有在 API explorer 中得到结果。问题是我正在为某些帐户而不是其他帐户获取 displayName。如果用户还没有 google plus 帐户,有什么方法可以强制他创建 google plus 帐户。
-
我得到了那些不是 google plus 用户的空白名称。有没有办法让用户在登录应用程序之前创建一个 google plus 帐户。
-
您在登录流程中要求什么
scopes? -
我正在使用 plus.email 和 plus.profile 范围。我想我需要使用已弃用的 userinfo.email 和 userinfo.profile 范围,以迫使用户在他的 gmail 帐户未链接到 google plus 帐户时创建新的 google plus 个人资料。
标签: google-api google-plus google-api-php-client google-api-client