Hello!
I have a Google service account for C# API.
1. I have downloaded the JSON key file, and use this code:
credential = GoogleCredential.FromStream(key);
2. In the google admin console, I authorized the client API with client id and the following permissions:
https://www.googleapis.com/auth/plus.me https://www.googleapis.com/auth/plus.profiles.read https://www.googleapis.com/auth/plus.stream.write3. Next step, I set the scopes:
credential = credential.CreateScoped(new string[]
{
PlusDomainsService.Scope.PlusMe,
PlusDomainsService.Scope.PlusStreamWrite,
PlusDomainsService.Scope.PlusProfilesRead
});
4. Make the service:
PlusDomainsService service = new PlusDomainsService(new BaseClientService.Initializer()
{
HttpClientInitializer = credential,
ApplicationName = "Poster",
});
5. Get user info:
var people = service.People.Get("me").Execute();
This call returns 403 - Forbidden (global domain) error.
What is the problem with this flow?
Finally, I would like to share posts from C# code.
Thanks.