I\'m trying to use the Google Drive API through the App Identity interface provided with Google App Engine. This basically allows my web application to communicate with Goog
AFAICT you should be using Bearer
in the Authorization header.
Probably what's happening is, Drive API doesn't recognize the service account (because of the wrong header?) and thus taking it as an anonymous request since no key
parameter wasn't provided either (see common query params).
Try this:
connection.addRequestProperty("Authorization", "Bearer " + accessToken.getAccessToken());
Or you could try adding the token as access_token
query param.