OAuth “nested” params

35 views
Skip to first unread message

Shaliko Usubov

unread,
Oct 3, 2011, 10:57:23 AM10/3/11
to OAuth Ruby
The problem with the Ruby library OAuth (0.4.5) when I use a "nested"
params in the query.

Example:

That does not work that request

current_user.myapp.client.post('/api/weights', {"weight[value]"=> 65})
I got

---! Ruby object:Net::HTTPUnauthorized
body:! str
str: Invalid OAuth Request
"@ _rails_html_safe": false
body_exist: true
code: "401"
And this is working

current_user.myapp.client.post('/api/weights', {:weight => {:value =>
65})
But the params do not come correct:

Parameters: {"weight" => "value65"}

Shaliko Usubov

unread,
Oct 4, 2011, 5:55:36 AM10/4/11
to OAuth Ruby
I think the problem in OAuth::RequestProxy::RackRequest class. I
looked at the implementation
ActionControllerRequest#parameters_for_signature.

Shaliko Usubov

unread,
Oct 5, 2011, 11:24:08 AM10/5/11
to OAuth Ruby
Fixed this bug https://github.com/oauth/oauth-ruby/pull/35

On 4 окт, 13:55, Shaliko Usubov <shal...@ezid.ru> wrote:
> I think the problem in OAuth::RequestProxy::RackRequest class. I
> looked at the implementation
> ActionControllerRequest#parameters_for_signature.
>
> On 3 ÏËÔ, 18:57, Shaliko Usubov <shal...@ezid.ru> wrote:
>
>
>
>
>
>
>
> > The problem with the Ruby library OAuth (0.4.5) when I use a "nested"
> > params in the query.
>
> > Example:
>
> > That does not work that request
>
> > current_user.myapp.client.post('/api/weights', {"weight[value]"=> 65})
> > I got
>
> > ---! Ruby object:Net::HTTPUnauthorized
> > body:! str
> > š šstr: Invalid OAuth Request
> > š š"@ _rails_html_safe": false
Reply all
Reply to author
Forward
0 new messages