【发布时间】:2011-08-22 21:44:33
【问题描述】:
我正在尝试使用 AuthSub 从 Google Health 请求令牌。它说范围是坏的或丢失。我已经仔细检查过,范围对我来说看起来不错。我尝试用日历替换范围,但没有收到该错误。
这是一个代码 sn-p
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)
【问题讨论】:
-
为我工作。当我转到您的代码生成的 URL 时,我得到一个 google 页面,询问要使用哪个帐户,然后说“站点 localhost 正在请求访问您的 Google 帐户以获取下面列出的产品。Google 日历”
-
啊,我看到您使用日历只是为了进行健全性测试。我将重新检查健康状况。是的“范围参数错误或丢失”。
标签: python google-app-engine authentication gdata-api authsub