0

i am developing a class library for a web server and used Google+ API to get information from my G+ profile.

For authentification i use https://developers.google.com/api-client-library/dotnet/guide/aaa_oauth (Service account).

When i query myPlusService.People.List("myGoogle+Id",PeopleResource.ListRequest.CollectionEnum.Visible).execute();

it delivers empty result, even though there are some when i use this platform: https://developers.google.com/+/api/latest/people/list

Is the problem lies in Credentials? If yes, which method should i use? Thank you.

sstephen
  • 161
  • 1
  • 12

2 Answers2

0

A few points:

  1. Make sure you're requesting the https://www.googleapis.com/auth/plus.login scope
  2. You must authorize the user. Simply using the developer API key is not enough

If you are doing those two things, you should check your access token using OAuth 2 token verification.

The people made visible to your app are in the control of the user. If the user does not make people in their circles visible, you will get empty API responses, which may be why the list is empty. When you see the OAuth dialog, make sure to select the people you want to make visible to the app and see if that helps. If you aren't prompted to select people to make visible, you are requesting the incorrect scope.

class
  • 8,621
  • 29
  • 30
  • the problem is that i used the service developer account in Service account authentification. In my case, it is also not possible to make an OAuth Dialog. Is it possible to access my personal account from the service developer account? – sstephen Jul 07 '14 at 08:05
  • If you are using Google Apps for Domains, you can use a service account, for the Global Google+, you cannot. – class Jul 10 '14 at 15:08
0

I was having the same problem, maybe the solution is the same. In my case the problem is that, even if the user was granting me plus.login, he still has to say circles that your app can see. This can be done in 2 ways:

  • in the dialog, after there is a link saying something like "Edit list". Once there you can add those dialogs that you want your app to be able to see.
  • in the application management you can select "Advanced connection settings" and add those circles.

This worked for me. However, I am still searching for a way of doing this directly since it appears the default dialog doesn't add this "permissions to see those circles". Which is ironic because if you open the list they are all selected by default.