Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/haskell/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google api Google Plus域API访问令牌刷新错误_Google Api_Google Plus_Google Apps_Google Api Python Client_Google Admin Sdk - Fatal编程技术网

Google api Google Plus域API访问令牌刷新错误

Google api Google Plus域API访问令牌刷新错误,google-api,google-plus,google-apps,google-api-python-client,google-admin-sdk,Google Api,Google Plus,Google Apps,Google Api Python Client,Google Admin Sdk,我正在尝试使用Google+域API为我的Google应用程序域提供圆圈。我正在使用域范围的委派,根据该委派,我已成功地用于组、用户和日历资源调配。在API控制台中,我将Google+API和Google+域API添加到API项目中。我尝试使用预先存在的密钥,并生成一个新密钥。当我尝试运行以下代码时: service_account_email='somelongstring@developer.gserviceaccount.com' key=file("path/to/keyfile","r

我正在尝试使用Google+域API为我的Google应用程序域提供圆圈。我正在使用域范围的委派,根据该委派,我已成功地用于组、用户和日历资源调配。在API控制台中,我将Google+API和Google+域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)
我明白了

当它点击build()调用时

但是,完全相同的代码(具有不同的作用域和服务)适用于目录服务、groupssettings服务和日历服务

我已经尝试使用角色帐户作为子电子邮件地址,以及我自己的(超级管理员)帐户


有什么想法吗?

您是否记得在域的控制面板中为新作用域授予服务帐户授权?这个过程。确保输入Google Plus域范围以及目录和组设置范围,因为任何更改都会覆盖您现有的授权。

我编写了一个教程,介绍如何在Google App Engine上使用Python新的G+域API,它将逐步解释每个必要的配置,并提供一些示例代码:

另外,别忘了官方的快速入门,但要记住,这一款在AppEngine上不起作用

AccessTokenRefreshError: access_denied