简体   繁体   中英

Google Cloud Endpoints User#getUserId different than profile id on Google+

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM