0

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

Tadeas Kriz
  • 524
  • 4
  • 14

1 Answers1

2

Use the Google+ API.

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

Jon Newmuis
  • 25,722
  • 2
  • 45
  • 57
  • Yes, I'm trying it with the google-api-client-java, but it's very unclear. I mean, every sample shows the usage differently and I'm not really sure which one to choose. – Tadeas Kriz Aug 16 '13 at 21:42
  • Are you specifically using the Google+ API? google-api-client-java includes many things. – Jon Newmuis Aug 16 '13 at 23:11
  • Well, I was trying a lot to get the most out of the examples and I think I'm getting close to achieving the final goal, getting google+ id. Thank you for your help! – Tadeas Kriz Aug 16 '13 at 23:28