1
我正在嘗試與rails應用程序集成Withings。我正在使用一個叫omniauth-withings的供應商Omniauth。我能夠配置提供者以允許我訪問重定向到Withings授權頁面的/ auth/withings。在允許訪問後,瀏覽器被重定向到回調url/auth/withings/callback。我把它路由到一個控制器動作,試圖從Withings獲得測量數據,使用simplificator-withings gem。Withings API狀態代碼2555
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
有我丟失的東西嗎?
問題出在第一行。我將應用程序密鑰設置爲應用程序密鑰的祕密和祕密。一旦我糾正了這個錯字,它就起作用了。 – Carlosfocker 2014-09-16 22:16:22