Authentication fails in databasedotcom
databasedotcom-gem, salesforce
Solution
It turns out this is due to a bug in databasedotcom. When you use username and password to authenticate, it puts them into an url query string WITHOUT encoding and POST a request with that url. As a result, the plus sign in my username will be interpreted as a blank space.
Solution: CGI::escape() both your username and password.
Problem
I am trying to adopt databasedotcom gem, but couldn't get beyond the authentication. Here is what I did (after installing databasedotcom gem): - rails c (or irb then require 'databasedotcom') - client=Databasedotcom::Client.new :client_id => 'foo', :client_secret=>'bar' - client.ca_file = '/Users/tjiang/missioncontrol/tmp/ca-bundle.crt' - client.verify_mode = OpenSSL::SSL::VERIFY_PEER - client.authenticate :username=>'myusername', :password=>'mypassword' All credentials are copy-and-pasted in the process so no mistake there; the certificate was downloaded here: http://certifie.com/ca-bundle/ca-bundle.crt.txt I tried Ruby 187 and 193 as well as inside and outside Rails, repeatedly, but always got this error message: Databasedotcom::SalesForceError: authentication failure from /Library/Ruby/Gems/1.8/gems/databasedotcom-1.3.0/lib/databasedotcom/client.rb:112:in `authenticate' I wonder what I have missed here? Particularly, I am concerned about the Callback URL I used when creating a Remote Access in Salesforce (I tried 'oob', 'http://localhost:3000', and 'https://www.salesforce.com', but none made any difference).