“瞄准镜损坏或丢失”尝试将 AuthSub 与 google health 结合使用时出错?
我正在尝试使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不熟悉 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.