Authentication failed in databasedotcom

I am trying to use databasedotcom gem but could not go beyond authentication. Here is what I did (after installing databasedotcom gem):

  • rails c (or irb then requires "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 copied and pasted into the process, so there is no error; The certificate was uploaded here: http://certifie.com/ca-bundle/ca-bundle.crt.txt

I tried Ruby 187 and 193 many times, as well as inside and outside of Rails, but always got this error message:

Databasedotcom :: SalesForceError: authentication failed from / Library / Ruby / Gems / 1.8 / gems / databasedotcom-1.3.0 / lib / databasedotcom / client.rb: 112: in `authenticate '

I wonder what I missed here? In particular, I am worried about the callback URL that I used when creating remote access in Salesforce (I tried "oob", "http: // localhost: 3000" and "https://www.salesforce.com", but none matter).

+3
source share
1 answer

, ​​databasedotcom. , url POST- URL-. .

: CGI:: escape() .

+5

All Articles