我尝试通过restforce gem连接到salesforce。我用下一个:
client = Restforce.new(username: 'user@name.com',
password: 'my_password',
client_id: 'Consumer_Key',
client_secret: 'Consumer_Secret',
security_token: 'security_token',
api_version: '38.0',
grant_type: 'password',
ssl: {version: 'TLSv1'})
contacts = client.query("select ID__c from Contacts where Name = 'Lorem Ipsum'")
puts contacts.first
当我尝试执行它时,我收到下一个错误:
'authenticate!': invalid_grant: authentication failure (Restforce::AuthenticationError)
在salesforce app我设置:
选中已启用和已停用的OAuth。
我也尝试过简单的配置:
client = Restforce.new(username: 'user@name.com',
password: 'my_password',
client_id: 'Consumer_Key',
client_secret: 'Consumer_Secret',
api_version: '38.0',)
但得到了同样的错误
指定了salesforce的有效凭据。
我做错了什么?