0

I have some confusion regarding Ruby and OAuth. Basically, this is what I'm doing:

@oauth.get('/foo.json?page=1')

However, for some reason outside of my understanding, the provider application is only receiving /foo.json, with the get params stripped.

I'm wondering if I'm missing something obvious here.

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
Oscar Del Ben
  • 4,485
  • 1
  • 27
  • 41

1 Answers1

0

For OAuth 1.0a / RFC 5849, you may find my Signet OAuth implementation substantially easier to work with than the oauth gem. Documentation should be pretty straight-forward. OAuth 2.0 support is in progress and coming soon.

In your specific case, however, it's an issue with the design of the oauth gem. The first parameter to the get function is the path. Not the full request URI. They apparently assume that no one will ever use query parameters with that particular method? My guess is that the rationale here is that, since query parameters have to be signed, parsing the request URI reliably and merging the parameters in was more work than they wanted to do?

With apologies to the authors of that library, my recommendation is to simply avoid using it. It's just really poorly designed in my opinion. It's a good-enough implementation for some things, but if you're talking to an API that isn't using the corresponding OAuth server for Ruby, I don't think it does a very good job.

Bob Aman
  • 32,839
  • 9
  • 71
  • 95
  • Thanks for your answer, it sounded strange to me that I couldn't use query params, it just doesn't make sense. I'll take a look at your library and see what I can do. – Oscar Del Ben Nov 22 '10 at 22:02