1

我正在尝试使用 AuthSub 从谷歌健康请求令牌。它说范围是坏的或丢失。我已经仔细检查过,范围对我来说看起来不错。我尝试用日历替换范围,但没有收到该错误。

这是一个代码片段

next = 'http://localhost:8080/auth'
# h9 scope for development
#scope = 'https://www.google.com/health/feeds/'
scope = 'https://www.google.com/calendar/feeds/'
#scope = 'https://www.google.com/h9/feeds/'
url_format = 'https://www.google.com/accounts/AuthSubRequest?next=%s&scope=%s&secure=%d&session=%d'
auth_sub_url = url_format % (next, scope, 0, 1)
#auth_sub_url = service.GenerateAuthSubURL(next, scope, secure = secure, session = session)
self.response.out.write('<a href="%s">Authorize Access to Your Google Health Account</a>' % auth_sub_url)
4

1 回答 1

1

我不熟悉谷歌健康,但做了一些谷歌搜索,你需要先注册你的网站:

https://services.google.com/fb/forms/googhealthdevelopers/

完成此注册需要一周的时间。同时,您可以使用以下网址对 H9 沙箱进行测试:

https://h9.google.com/h9/authsub?next=http://localhost:8080/auth&scope=https://www.google.com/health/feeds/&secure=0&session=1

显然,如果您在注册网站之前尝试通过https://www.google.com/accounts/AuthSubRequest使用 Google Health ,那么您会收到该错误消息。如果你必须先注册你的网站,你应该如何测试 localhost,我不知道。

于 2011-05-11T00:44:16.017 回答