-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Withings provider not working? #134
Comments
You are right, the withings API seems to have a custom implementation of oauth 1. I guess we should support the oauth 1 parameters to be in the query string in the configuration files, based on how the request lib builds the params (https://github.com/request/request/blob/master/request.js#L1622). For now you need to use this code to build and send the oauth params in the query. Don't hesitate to send a pull request if you want to contribute to oauthd. In the meantime, we will send a support ticket to Withings to see if they plan to fix this. |
Okay, I may end up working on this. |
After looking closer at this issue, it appears that the oauth functionality of request.js would need to be completely bypassed in order for this to work with the withings API as it exists today. The problem is here: https://github.com/request/request/blob/master/request.js#L1676. The items in the query string are concatenated with the oauth parameters to create the signature. If a signature were prepopulated and included in the query string, the resulting signature would be different than the precalculated one. I assume that code to implement those oauth specifics when its currently all taken care of in request.js would never get merged back to oauthd. Does that sound right? I was able to get this working by hacking request.js to add the parameters but that change will never be accepted either. For now I suppose I can run my modified version of oauthd instead of using the oauth.io service directly. Did you have any luck communicating with Withings about the issue? |
I just looked a bit closer at the oauth1 spec. It appears that the withings method is a valid method according to the spec. Here is the section on "Consumer Request Parameters" (http://oauth.net/core/1.0/#consumer_req_param):
Maybe its not entirely unreasonable for request.js to support this. |
Okay, I added support to request.js for this. The option is oauth.transport_method. I can create a pull request for oauthd to support this. What should the configuration option for the provider look like? |
Hi there,
Maybe I'm just doing something drastically wrong but I can't get the withings requests to work. I'm able to get authorized but once I make an actual request for data I'm always getting the following response:
status: "503"
error: "Not enough params"
I was getting this same error using the oauth.io service so I installed oauthd to try and further debug the issue. Its somewhat difficult to tell whats going on but my suspicion is that the oauth parameters are not getting sent along with the request parameters in the correct way. Withings wants them in the query string which is unusual for an oauth implementation.
As far as I can tell the request library which is used for signing doesn't support this.
Maybe I'm crazy. Does anyone have this working?
The text was updated successfully, but these errors were encountered: