7
votes

I am trying to create application default credentials for my app engine project for accessing google APIs. I am developing in eclipse IDE and I have defined the environment variable:GOOGLE_APPLICATION_CREDENTIALS to point to the json key file downloaded to my computer. But, I am gettin following exception:

java.io.IOException: Application Default Credentials failed to create the Google App Engine service account credentials class com.google.api.client.googleapis.extensions.appengine.auth.oauth2.AppIdentityCredential$AppEngineCredentialWrapper. Check that the component 'google-api-client-appengine' is deployed.

Stacktrace:

Application Default Credentials failed to create the Google App Engine service account credentials class
com.google.api.client.googleapis.extensions.appengine.auth.oauth2.AppIdentityCredential$AppEngineCredentialWrapper. Check that the component 'google-api-client-appengine' is deployed. java.io.IOException: Application Default Credentials failed to create the Google App Engine service account credentials class com.google.api.client.googleapis.extensions.appengine.auth.oauth2.AppIdentityCredential$AppEngineCredentialWrapper. Check that the component 'google-api-client-appengine' is deployed. at com.google.api.client.googleapis.auth.oauth2.DefaultCredentialProvider.tryGetAppEngineCredential(DefaultCredentialProvider.java:282) at com.google.api.client.googleapis.auth.oauth2.DefaultCredentialProvider.getDefaultCredentialUnsynchronized(DefaultCredentialProvider.java:161) at com.google.api.client.googleapis.auth.oauth2.DefaultCredentialProvider.getDefaultCredential(DefaultCredentialProvider.java:88) at com.google.api.client.googleapis.auth.oauth2.GoogleCredential.getApplicationDefault(GoogleCredential.java:213) at com.google.api.client.googleapis.auth.oauth2.GoogleCredential.getApplicationDefault(GoogleCredential.java:191)

1
Hi, could you resolve the issue?Aram Paronikyan

1 Answers

14
votes

You may be missing one or more of the required dependencies. Here's what I am including with a working app that uses AppIdentity from the development server:

<dependency>
  <groupId>com.google.api-client</groupId>
  <artifactId>google-api-client</artifactId>
  <version>1.21.0</version>
</dependency>
<dependency>
  <groupId>com.google.api-client</groupId>
  <artifactId>google-api-client-appengine</artifactId>
  <version>1.21.0</version>
</dependency>
<dependency>
  <groupId>com.google.api-client</groupId>
  <artifactId>google-api-client-servlet</artifactId>
  <version>1.21.0</version>
</dependency>