anandsekar272 / google-api-java-client

Automatically exported from code.google.com/p/google-api-java-client
0 stars 0 forks source link

ComputeCredential that accepts a ServiceAccountCredential when running locally #815

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
External references, such as a standards document, or specification?

http://javadoc.google-api-java-client.googlecode.com/hg/1.15.0-rc/com/google/api
/client/googleapis/compute/ComputeCredential.html

https://developers.google.com/compute/docs/authentication

https://code.google.com/p/google-api-java-client/issues/detail?id=750

https://developers.google.com/accounts/docs/OAuth2ServiceAccount

Java environments (e.g. Java 6, Android 2.3, App Engine, or All)?

Compute Engine only.

Please describe the feature requested.

Unfortunately ComputeCredential only works in production.  So typically in 
order to test the app locally, a developer needs to use service accounts using 
ServiceAccountCredential when running locally.  Ideally one would find some 
mechanism to determine if the code is running in production, so that no code 
needs to be changed between running locally and in production, to end up with 
something like:

HttpRequestInitializer httpRequestInitializer;
if (running locally) {
  httpRequestInitializer = new ServiceAccountCredential....;
} else {
  httpRequestInitializer = new ComputeCredential....;
}

We can simplify this developer experience by combining the functionality of 
ServiceAccountCredential into ComputeCredential, so the developer can specify 
the service account to use when running locally.

Original issue reported on code.google.com by yan...@google.com on 18 Jul 2013 at 6:14

GoogleCodeExporter commented 9 years ago

Original comment by yan...@google.com on 13 Aug 2013 at 10:06

GoogleCodeExporter commented 9 years ago

Original comment by yan...@google.com on 27 Sep 2013 at 11:59

GoogleCodeExporter commented 9 years ago

Original comment by mnru...@google.com on 4 Oct 2013 at 4:08