I was trying to use the service account of my App to access to all documents of all users in my domain. I was following these instructions: https://developers.google.com/drive/delegation
But it didn't work. Could you please help me out on this??
Here is the problematic line of code
GoogleCredential credential = new GoogleCredential.Builder() .setTransport(TRANSPORT) .setJsonFactory(jsonFactory) .setServiceAccountId("SERVICE_ACCOUNT_EMAIL") .setServiceAccountPrivateKeyFromP12File( new java.io.File("SERVICE_ACCOUNT_PKCS12_FILE_PATH")) .setServiceAccountScopes(scopes) .setServiceAccountUser("abc@xyz.com").build();
It's working fine, but it should give me details for all the user for this domain... Instead it gives me only for one useraccount.. In the "Service" account doc it says it should be able to access all the user's data under this domain.
Scopes are added and APIS are enabled for this account