python - 尝试将 AuthSub 与 google health 结合使用时出现“范围损坏或丢失”错误?

标签 python google-app-engine authentication gdata-api authsub

我正在尝试使用 AuthSub 向 google health 请求 token 。它说瞄准镜损坏或丢失。我已经仔细检查过,范围对我来说看起来不错。我尝试用日历替换范围,但没有收到该错误。

这是一个代码片段

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)

最佳答案

我不熟悉 Google Health,但进行了一些 Google 搜索,您需要先注册您的网站:

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

此注册需要一周时间才能完成。同时,您可以使用如下 url 来测试 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在注册您的网站之前,您会收到该错误消息。如果您必须首先注册您的网站,您应该如何针对本地主机进行测试,我不知道。

关于python - 尝试将 AuthSub 与 google health 结合使用时出现“范围损坏或丢失”错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5957856/

相关文章:

python - 如何在不同的端口上运行 Python Eve 应用程序

python - 删除 pandas 数据框中具有特定日期时间值的某些行

python - 如何通过并取消这个小程序

java - 如何使用 XMPP java 向用户发送聊天邀请?

c# - 如何解决使用Microsoft帐户登录时出现AADSTS700016错误?

android - 我可以自定义 firebase OTP 数字(默认 6 到 4)吗?

python - 如何使用另一个列表中的列表值作为 Python 中函数的参数

google-app-engine - 部署谷歌服务帐户时无权访问应用程序

google-app-engine - Azure AD 与 GAE 集成

android - 在 Okhttp 中处理身份验证