使用管理权限/模拟(禁止403)下载用户文件我看了这个彻底:https://developers.google.com/google-apps/documents-list/#using_google_apps_administrative_access_to_impersonate_other_domain_users 我用Google搜索这个死亡。谷歌文档:无法导出/ Python中
到目前为止,我已经能够:
授权使用:
- 的ClientLogin
- OAuth凭证(使用我的域密钥)
检索文档供稿对于域中的所有用户(在#1中以任一方式授权)
我正在使用Feed中的“条目”导出/下载文档,并且始终禁止其他用户查看未与管理员共享的文档。我使用的进料的查询是这样的:https://docs.google.com/feeds/[email protected]/private/full/?v=3
(?我已经有和没有试图V = 3)
我还试图加入xoauth_requestor_id(我还看到在帖子为xoauth_requestor) ,无论在URI,并作为一个客户端特性:client.xoauth_requestor_id = ...
代码片段:
客户端登录(使用管理员凭据):
client.http_client.debug = cfg.get('HTTPDEBUG')
client.ClientLogin(cfg.get('ADMINUSER'), cfg.get('ADMINPASS'), 'HOSTED')
的OAuth:
client.http_client.debug = cfg.get('HTTPDEBUG')
client.SetOAuthInputParameters(gdata.auth.OAuthSignatureMethod.HMAC_SHA1, cfg.get('DOMAIN'), cfg.get('APPS.SECRET'))
oatip = gdata.auth.OAuthInputParams(gdata.auth.OAuthSignatureMethod.HMAC_SHA1, cfg.get('DOMAIN'), cfg.get('APPS.SECRET'))
oat = gdata.auth.OAuthToken(scopes = cfg.get('APPS.%s.SCOPES' % section), oauth_input_params = oatip)
oat.set_token_string(cfg.get('APPS.%s.TOKEN' % section))
client.current_token = oat
Feed后检索:
# pathname eg whatever.doc
client.Export(entry, pathname)
# have also tried
client.Export(entry, pathname, extra_params = { 'v': 3 })
# and tried
client.Export(entry, pathname, extra_params = { 'v': 3, 'xoauth_requestor_id': '[email protected]' })
任何建议或指针来什么,我在这里失踪? 谢谢
如果对这一问题的回答,可以将其标记回答?另外,请发布一个新问题,并附上步骤来重现您在评论中提到的其他401s/403s。 – 2012-04-13 12:56:24