Fitbit OAuth注册 [英] Fitbit oauth registration

查看:184
本文介绍了Fitbit OAuth注册的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序链接到FitBit API.用户(通过我的门户网站)通过FitBit的OAUTH API授予我的应用访问权限,以为用户获取数据.除了我的许多用户使用共享计算机外,其他所有功能都工作正常. FitBit会记住前一个用户的凭据,并且在他们请求访问权限时不提示输入密码.最终结果是,我得到了与当前用户关联的先前用户的fitbit.有没有一种方法可以强制实际的fitbit登录屏幕(通过清除cookie?),而不是让fitbit记住它们?有谁知道如何做到这一点?如果重要的话,我正在将php与net.manuellemos.oauth oauth软件包一起使用.

My app links to the FitBit API. The users (via my portal) give my app access permission via FitBit's OAUTH API to grab data for the users. All works fine EXCEPT many of my users use a shared computer. FitBit is remembering credentials from the previous user and not prompting for a password when they request permission for access. The end result is that I get the previous user's fitbit associated with the current user. Is there a way to force the actual fitbit login screen (by erasing cookies?) instead of having fitbit remember them? Does anyone know how to do this? I'm using php with the net.manuellemos.oauth oauth package if that matters.

推荐答案

解决方案是向URL添加requestCredentials = true. 因此,与其将它们发送到: https://api.fitbit.com/oauth/authorize?oauth_token= {my令牌}

The solution was to add requestCredentials=true to the url. So instead of sending them to: https://api.fitbit.com/oauth/authorize?oauth_token={my token}

我将其发送至: https://api.fitbit.com/oauth/authorize?requestCredentials=true& oauth_token = {我的令牌}

i send them to: https://api.fitbit.com/oauth/authorize?requestCredentials=true&oauth_token={my token}

如果您使用的是net.manuellemos.oauth程序包,则这是对oauth_configuration.json文件的更改. fitbit部分现在应如下所示:

if you're using the net.manuellemos.oauth package like i am, this is a change in the oauth_configuration.json file. the fitbit section should now look like this:

  "Fitbit":
  {
     "oauth_version": "1.0a",
     "request_token_url": "https://api.fitbit.com/oauth/request_token",
     "dialog_url": "https://api.fitbit.com/oauth/authorize?requestCredentials=true",
     "access_token_url": "https://api.fitbit.com/oauth/access_token"
  },

这篇关于Fitbit OAuth注册的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆