1

Does the Google API CPP Client Library support Authorization using Service Account?

I could not find an example of how to use the Service Account when using the CPP Client library from https://github.com/google/google-api-cpp-client/

The sample available only demonstrate using Client Secret for installed application

flow_.reset(OAuth2AuthorizationFlow::MakeFlowFromClientSecretsPath( client_secrets_file, config_->NewDefaultTransportOrDie(), &status));
ND003
  • 726
  • 1
  • 8
  • 22
  • I found this link http://www.example-code.com/unicodeCpp/http_xoauth2_access_token.asp for c++ service account. But I am not sure whether this is the one you are looking for. It should be almost similar to http://www.daimto.com/google-drive-api-with-a-service-account/ – SGC Jun 17 '15 at 21:04

1 Answers1

0

I've spend quite some time figuring this out. The harsh answer is no. Compared to the Python or PHP version of this library, the CPP version is pretty much outdated.

A quick solution might be to fetch the required data from Google and write the result to a file using the Python client libraries. I.e. with std::system(). Then parse the file from your C++ application.

Thijs
  • 714
  • 9
  • 23