Google Cloud Endpoints用户#getUserId与Google+上的个人资料ID不同 [英] Google Cloud Endpoints User#getUserId different than profile id on Google+

查看:141
本文介绍了Google Cloud Endpoints用户#getUserId与Google+上的个人资料ID不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用GWT和Cloud Endpoints来编写appengine的应用程序。对于云端点,我使用授权,如下所示:使用Auth与端点。使用范围 https://www.googleapis.com/auth/userinfo.email 。因为我需要不同的用户角色,所以我尝试使用 User#getUserId ,我认为这将是Google+个人资料的ID。虽然这是不正确的,并且这是完全不同的(好吧,它有相同的长度)。问题是,我找不到,如何找到这个id不同于 User#getUserId 的方式,因此它使得向管理角色添加新用户非常困难。我也试过使用不同的范围,但它没有奏效。



我的问题是,为什么这个ID与Google+ ID不同,并且如果有方式简单地获取Google+ id?



以下是我正在谈论的值:

Id 用户# getUserId :101329505878094971459

来自Google+个人资料的ID:113085797747084826112

解决方案

使用 Google+ API



您可以没有他们同意给你他们的Google+ ID,就不会获得用户的Google+ ID。

I've been writing application for appengine, using GWT and Cloud Endpoints. For Cloud Endpoints I use authorization as shown here: Using Auth with Endpoints. With scope https://www.googleapis.com/auth/userinfo.email. Because I need different roles for users, I've tried to use User#getUserId and I thought this will be the id of Google+ profile. Although that's not true and this is completely different (well, it has the same length). The problem is, I can't find out, how to find this id a different way than User#getUserId and thus it makes it really difficult to add new users to admin roles. I've also tried to use different scopes, but it didn't work.

My question is, why is this id different from the Google+ id and if there is a way to simply obtain the Google+ id?

These are the values I'm talking about:
Id from User#getUserId: 101329505878094971459
Id from Google+ profile: 113085797747084826112

解决方案

Use the Google+ API.

You can't get a user's Google+ ID without them consenting to giving you their Google+ ID.

这篇关于Google Cloud Endpoints用户#getUserId与Google+上的个人资料ID不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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