I am getting this exception with facebook_oauth 0.2.0 in production server ———–
OAuth2::HTTPError: Received HTTP 400 during request.>
Received HTTP 400 during request.
/usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/oauth2-0.1.0/lib/oauth2/client.rb:80:in `request'
/usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/oauth2-0.1.0/lib/oauth2/strategy/web_server.rb:15:in `get_access_token'
=> when executing this line of ruby code, access_token = @client.authorize(:code => params[:code])
But the same code working in the local server. I stumbled last two days about this issue. Anyone please help me??
I had this exact same problem and spent a fair few maddening hours analysing what looked like good code. Then I did a simple inspect on my oauth client and discovered that it was missing the secret key!
I’d misspelt the ref of the secret key when pulling it from my config YML file! The first part of the authorization process doesn’t need the secret, so didn’t fail. Anyway, added the secret in, and bamn!