emran396 / google-api-java-client

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

AppIdentityCredential that accepts a ServiceAccountCredential when running locally #814

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/extensions/appengine/auth/oauth2/AppIdentityCredential.html

https://developers.google.com/appengine/docs/java/appidentity/#Java_Asserting_id
entity_to_Google_APIs

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)?

App Engine only.

Please describe the feature requested.

Unfortunately AppIdentityCredential 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.  So no code needs to be changed 
between running locally and in production, this is wrapped by something like:

HttpRequestInitializer httpRequestInitializer;
if (com.google.appengine.api.utils.SystemProperty.environment.value() == 
com.google.appengine.api.utils.SystemProperty.Environment.Value.Development) {
  httpRequestInitializer = new ServiceAccountCredential....;
} else {
  httpRequestInitializer = new AppIdentityCredential....;
}

We can simplify this developer experience by combining the functionality of 
ServiceAccountCredential into AppIdentityCredential, 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:01

GoogleCodeExporter commented 9 years ago

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

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:09

GoogleCodeExporter commented 9 years ago
see https://codereview.appspot.com/13606047/

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