【发布时间】:2013-08-18 07:35:18
【问题描述】:
我正在尝试使用 Google+ Domains API 为我的 Google Apps 域配置圈子。我根据https://developers.google.com/+/domains/authentication/delegation 使用域范围的委派,我已经成功地将其用于组、用户和日历配置。在 API 控制台中,我已将 Google+ API 和 Google+ Domains API 添加到 API 项目中。我已经尝试使用预先存在的密钥并生成一个新密钥。当我尝试运行以下代码时:
service_account_email='somelongstring@developer.gserviceaccount.com'
key=file("path/to/keyfile","rb").read()
user_email='someroleaccount@mydomain.com'
SCOPES_PLUS = [
'https://www.googleapis.com/auth/plus.me',
'https://www.googleapis.com/auth/plus.stream.write',
]
credentials = SignedJwtAssertionCredentials(service_account_email, key,
scope=SCOPES_PLUS, sub=user_email)
http = httplib2.Http()
http = credentials.authorize(http)
plus = build(serviceName='plus', version='v1domains', http=http)
我明白了
AccessTokenRefreshError: access_denied
当它遇到 build() 调用时。
但是,完全相同的代码(具有不同的范围和服务)适用于目录服务、组设置服务和日历服务。
我已尝试使用角色帐户作为子电子邮件地址,以及作为我自己的(超级管理员)帐户。
有什么想法吗?
【问题讨论】:
标签: google-api google-plus google-apps google-api-python-client google-admin-sdk