我正在尝试将Withing与rails应用程序集成起来。我使用的是一个名为奥姆尼奥特的杂食-withings提供程序。我能够将提供程序配置为允许我访问/auth/withings,它将重定向到Withing授权页面。在我允许访问之后,浏览器被重定向到回调url /auth/withing/回调。我已经将其路由到一个控制器操作中,该操作试图使用简化器-withings宝石从Withing获取测量数据。
Withings.consumer_secret = ENV['withings_app_key']
Withings.consumer_key = ENV['withings_app_secret']
auth_hash = request.env['omniauth.auth']
user_id = auth_hash.extra.raw_info.body.users.first.id
withings_user = User.authenticate(user_id, auth_hash.credentials.token, auth_hash.credentials.secret)
measurements = withings_user.measurement_groups(:device => Withings::SCALE)当我调用User.authenticate()时,就会遇到这样的问题:
An unknown error occurred - Status code: 2555这里有什么东西我遗漏了吗?
发布于 2014-09-05 16:06:53
我在django应用程序中也遇到了同样的错误。结果发现我用错了记号和秘密。我使用的是授权过程第1步返回的oauth_token和oauth_token_secret,而不是步骤3中的oauth_token和oauth_token_secret。确保使用的是步骤3中的值。API文档显示了从这些调用返回的相同值,但它们会有所不同。希望这对你也有帮助。
https://stackoverflow.com/questions/25596901
复制相似问题