简体   繁体   English

Fitbit OAuth注册

[英]Fitbit oauth registration

My app links to the FitBit API. 我的应用程序链接到FitBit API。 The users (via my portal) give my app access permission via FitBit's OAUTH API to grab data for the users. 用户(通过我的门户网站)通过FitBit的OAUTH API授予我的应用访问权限,以为用户获取数据。 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. FitBit会记住前一个用户的凭据,并且在他们请求访问权限时不提示输入密码。 The end result is that I get the previous user's fitbit associated with the current user. 最终结果是,我得到了与当前用户关联的先前用户的fitbit。 Is there a way to force the actual fitbit login screen (by erasing cookies?) instead of having fitbit remember them? 有没有一种方法可以强制实际的fitbit登录屏幕(通过擦除cookie?),而不是让fitbit记住它们? Does anyone know how to do this? 有谁知道如何做到这一点? I'm using php with the net.manuellemos.oauth oauth package if that matters. 如果有问题,我正在将php与net.manuellemos.oauth oauth软件包一起使用。

The solution was to add requestCredentials=true to the url. 解决方案是将requestCredentials = true添加到URL。 So instead of sending them to: https://api.fitbit.com/oauth/authorize?oauth_token= {my token} 因此,与其将它们发送到: https : //api.fitbit.com/oauth/authorize?oauth_token= {我的令牌}

i send them to: https://api.fitbit.com/oauth/authorize?requestCredentials=true&oauth_token= {my token} 我将它们发送到: https : //api.fitbit.com/oauth/authorize?requestCredentials=true&oauth_token= {我的令牌}

if you're using the net.manuellemos.oauth package like i am, this is a change in the oauth_configuration.json file. 如果您像我一样使用net.manuellemos.oauth软件包,则这是oauth_configuration.json文件中的更改。 the fitbit section should now look like this: fitbit部分现在应如下所示:

  "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"
  },

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM