“瞄准镜损坏或丢失”尝试将 AuthSub 与 google health 结合使用时出错?

发布于 2024-11-06 00:16:26 字数 713 浏览 0 评论 0原文

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

这是一个代码片段

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)

I'm trying to use AuthSub to request a token from google health. It says the scope was bad or missing. I've double checked, and the scope looks good to me. I've tried replacing the scope with calendar, and I don't get that error.

Here's a code snippet

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)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

千里故人稀 2024-11-13 00:16:26

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

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 在注册您的网站之前,您会收到该错误消息。如果您必须先注册您的网站,我不知道您应该如何针对本地主机进行测试。

I'm not familiar with Google Health, but did some Googling and you need to register your site first:

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

It takes a week for this registration to go through. Meanwhile you can test against H9 sandbox with an url like:

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

So apparently if you try to use Google Health through https://www.google.com/accounts/AuthSubRequest before registering your site, then you get that error message. How you are supposed to test against localhost if you have to register your site first, I have no idea.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文