The new Drive SDK
is very good for the authenticated user. Is it possible use Drive SDK
using Google Apps administrative access to impersonate other domain users?
The doclist API can do it but it's not possible manage and copy files (pdf, jpg) with this tool.
I'm using Java with this code:
credential_origine = new GoogleCredential.Builder().setTransport(HTTP_TRANSPORT)
.setJsonFactory(JSON_FACTORY)
.setServiceAccountId("[email from console api]")
.setServiceAccountScopes(DriveScopes.DRIVE)
.setServiceAccountUser("user@domain.com")
.setServiceAccountPrivateKeyFromP12File(new File("key.p12")).build();
But I get an error when I try to retrieve data for the user@domain.com. If I comment .setServiceAccountUser("user@domain.com")
the code works great for the same account I used for creating the key.
In the old DOCList API we impersonated another user by the URL of the requests. Is it something similar?