新版本Drive SDK对于经过身份验证的用户非常有用.是否可以使用Drive SDKGoogle Apps管理员权限模拟其他域用户?
doclist API可以做到这一点,但是用这个工具管理和复制文件(pdf,jpg)是不可能的.
我正在使用Java代码:
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();
Run Code Online (Sandbox Code Playgroud)
但是当我尝试为user@domain.com检索数据时出现错误.如果我评论.setServiceAccountUser("user@domain.com")该代码适用于我用于创建密钥的同一帐户.
在旧的DOCList API中,我们通过请求的URL模拟了另一个用户.它有类似的东西吗?