且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

OAuth Google API for Java 无法模拟用户

更新时间:2022-06-26 07:52:30

我发现了一个与我类似的问题:Google Apps 管理员可以使用 Drive SDK 管理用户文件吗? 帮助我找出答案.

I found a similar question as mine: Can a Google Apps Admin manage users files with Drive SDK? to mine which has helped me figure out the answer.

cPanel 文档有点误导,因为它提到启用使用者密钥,然后将域添加到管理 API 客户端访问屏幕.这似乎对 gdata api 有效,而对新的 Google Drive api 无效.通过添加另一个问题中建议的客户端 ID 并授予对 Drive 范围的访问权限,我现在可以模拟用户.

The cPanel documentation is a little misleading as it refers to enabling the consumer key and then adding the domain to the Manage API client access screen. This appears to be valid for the gdata api and not the new Google Drive api. By adding the client id as suggested in the other question and granting access to the Drive scope I'm now able to impersonate a user.