[oauth-ruby] ArgumentError (wrong # of arguments(3 for 2)):

9 views
Skip to first unread message

dmitry

unread,
May 7, 2010, 4:25:22 PM5/7/10
to OAuth Ruby
I'm using JRuby with oauth 0.4.0 gem

and it's failing with following stack trace:

oauth (0.4.0) lib/oauth/signature/hmac/base.rb:12:in `digest'
oauth (0.4.0) lib/oauth/signature/hmac/base.rb:12:in `digest'
oauth (0.4.0) lib/oauth/signature/base.rb:65:in `signature'
oauth (0.4.0) lib/oauth/signature.rb:23:in `sign'
oauth (0.4.0) lib/oauth/client/helper.rb:45:in `signature'
oauth (0.4.0) lib/oauth/client/helper.rb:75:in `header'
oauth (0.4.0) lib/oauth/client/net_http.rb:85:in `set_oauth_header'
oauth (0.4.0) lib/oauth/client/net_http.rb:30:in `oauth!'
oauth (0.4.0) lib/oauth/consumer.rb:223:in `sign!'
oauth (0.4.0) lib/oauth/consumer.rb:189:in `create_signed_request'
oauth (0.4.0) lib/oauth/consumer.rb:159:in `request'
oauth (0.4.0) lib/oauth/consumer.rb:195:in `token_request'
oauth (0.4.0) lib/oauth/consumer.rb:136:in `get_request_token'
app/controllers/application_controller.rb:89:in `join_sso_session'


Looks like there is some incompatibility in the lib/oauth/signature/
hmac/base.rb,

is the base.rb class part of JRuby install? Is it some how not
compatible with what OAuth expects?

thanks

--
You received this message because you are subscribed to the Google Groups "OAuth Ruby" group.
To post to this group, send email to oauth...@googlegroups.com.
To unsubscribe from this group, send email to oauth-ruby+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/oauth-ruby?hl=en.

Tim

unread,
May 8, 2010, 10:30:23 PM5/8/10
to OAuth Ruby
I have a hack of a work-around that (at least) works with NetFlix:

In 'oauth/signature/hmac/base.rb':

require 'digest/hmac'
+ require 'openssl'

...

- Digest::HMAC.digest(signature_base_string, secret,
self.class.digest_class)
+ digest = OpenSSL::Digest::Digest.new('sha1')
+ OpenSSL::HMAC.digest(digest, secret, signature_base_string)

I have tried to figure out why the original code fails to work, but so
far no luck.
tim

Tim

unread,
May 8, 2010, 3:17:42 PM5/8/10
to OAuth Ruby
I cannot find any place that describes what that call is supposed to
look like. I get the same error. I have tried using this:

::Digest::SHA1.digest( signature_base_string )

but that returns a very funny looking (lots of '?' characters) string
that always results in Unauthorized responses from NF.

This is an absolute show-stopper.


On May 7, 4:25 pm, dmitry <dmitry...@gmail.com> wrote:

Jens Wille

unread,
May 8, 2010, 7:21:59 AM5/8/10
to oauth...@googlegroups.com, dmitry
[re-posting as the first one didn't seem to make it through to the
list.]

hi dmitry!

dmitry [2010-05-07 22:25]:
> I'm using JRuby with oauth 0.4.0 gem
> [...]
> Looks like there is some incompatibility in the
> lib/oauth/signature/hmac/base.rb,
i'm not entirely sure right now, but it may be the same error we had
with ruby 1.8.5. we just returned to oauth-0.3.6 behaviour to "fix"
it. you can see our change here:

<http://prometheus-app.uni-koeln.de/trac/pandora/changeset/2610>

hope that helps.

cheers
jens

--
Jens Wille, Dipl.-Bibl. (FH)
prometheus - Das verteilte digitale Bildarchiv für Forschung & Lehre
Kunsthistorisches Institut der Universität zu Köln
Albertus-Magnus-Platz, D-50923 Köln
Tel.: +49 (0)221 470-6668, E-Mail: jens....@uni-koeln.de
http://www.prometheus-bildarchiv.de/

nosretep

unread,
May 7, 2010, 4:35:10 PM5/7/10
to OAuth Ruby
It looks like things have changed since OAuth version 0.3.2.

On May 7, 4:25 pm, dmitry <dmitry...@gmail.com> wrote:

Jens Wille

unread,
May 7, 2010, 5:04:50 PM5/7/10
to oauth...@googlegroups.com
hi dmitry!

dmitry [2010-05-07 22:25]:
> I'm using JRuby with oauth 0.4.0 gem
> [...]
> Looks like there is some incompatibility in the
> lib/oauth/signature/hmac/base.rb,
i'm not entirely sure right now, but it may be the same error we had
with ruby 1.8.5. we just returned to oauth-0.3.6 behaviour to "fix"
it. you can see our change here:

<http://prometheus-app.uni-koeln.de/trac/pandora/changeset/2610>

hope that helps.

cheers
jens

--
Jens Wille, Dipl.-Bibl. (FH)
prometheus - Das verteilte digitale Bildarchiv für Forschung & Lehre
Kunsthistorisches Institut der Universität zu Köln
Albertus-Magnus-Platz, D-50923 Köln
Tel.: +49 (0)221 470-6668, E-Mail: jens....@uni-koeln.de
http://www.prometheus-bildarchiv.de/

glenn gillen

unread,
May 14, 2010, 6:09:05 AM5/14/10
to OAuth Ruby
+1 for also experiencing this error.

OSX Snowleopard, JRuby 1.5, OAuth 0.4.0

Any ideas?

Aaron Quint

unread,
May 17, 2010, 10:56:41 PM5/17/10
to oauth...@googlegroups.com
I'll get JRuby installed and check this out tomorrow. Its strange
because the digest/hmac lib is directly pulled from Ruby 1.9.1. There
must be a conflict with the digests between JRuby and MRI.

--AQ

Aaron Quint
http://www.quirkey.com

Aaron Quint

unread,
May 19, 2010, 3:27:34 PM5/19/10
to oauth...@googlegroups.com
Hey All,

Just to give an update, I spent some time this morning tracking it
down and it turns out its a bug in jruby. I filed a ticket and theres
already been a patch submitted:

http://jira.codehaus.org/browse/JRUBY-4800?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Please vote it up, or bug your favorite jruby core member to get it merged :)
--AQ


Aaron Quint
http://www.quirkey.com



Reply all
Reply to author
Forward
0 new messages