Hi,
I have a Ruby on Rails application that works great in my computer and in my server. I'm moving this application to another server that runs on another hosting service, and I got a problem related to the OAuth Ruby Gem.
Any request I do using OAuth gem, I get:
OAuth::Unauthorized (401 Unauthorized):
oauth (0.4.3) lib/oauth/consumer.rb:217:in `token_request'
oauth (0.4.3) lib/oauth/consumer.rb:139:in `get_request_token'
...
My code is:
def self.consumer
# The readkey and readsecret below are the values you get during registration
OAuth::Consumer.new("XXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "YYYYYYYYYYYYYYYYYYYYYYYYYYYY", {:site => "http://api.twitter.com"})
end
def create_authorize_url
@request_token = UserController.consumer.get_request_token(:oauth_callback => "http://mysite.com/callback")
session[:request_token] = @request_token.token
session[:request_token_secret] = @request_token.secret
redirect_to @request_token.authorize_url
end
The problem is that the same code works well on my computer and in another servers. This happens only in one server. There's anything related to the firewall or something that can block OAuth calls?
I searched this error a lot and I didn't get any answer, and that's why I am asking this here.
Thanks.