2

Trying to configure the salesforce connector to read data from salesforce using Google Data Fusion, but can't connect to Salesforce.

I keep getting "Connection to salesforce with plugin configurations failed" error message when hitting the "get schema" button on the connector. My guess is that this related to my salesforce connected app, but can't really tell. Is it related to the callback URL setting in the connected app? Did anyone succeed connecting to Salesforce using Data fusion?

Yaniv
  • 21
  • 3

2 Answers2

4

It looks like the error is coming from https://github.com/data-integrations/salesforce/blob/abc563938e837b3bcfc42dbd4b26c0c6ef347451/src/main/java/io/cdap/plugin/salesforce/authenticator/Authenticator.java#L57.

Unfortunately it looks like the error message doesn't include anything from the root cause, but most likely it's failing during the oauth login, which makes a POST request to: [login url]?grant_type=password&client_id=[client id]&client_secret=[client secret]&username=[username]&password=[password]

You could try making that request manually and see if you get an error back.

Albert Shau
  • 226
  • 1
  • 3
  • `Authenticator.oauthLogin(...)` makes a POST request to Salesforce without explicitly setting a Content-Type, thus Salesforce rejects it. – identigral Jul 18 '19 at 05:54
  • I am getting the same error. Can someone tell me what the login URL should look like? I am currently using https://.salesforce.com. Is this correct? – FVCC Jul 26 '21 at 15:42
0

I was getting the same error, but I managed to solve it.

First things first, even though the Security Token is optional, I did not manage to make it work without it.

Apparently, depending on how your Salesforce instance is configured, if your password is mypassword, and your security token is XXXXXXXXXX, then the plugin uses mypasswordXXXXXXXXXX during the authentication.

Secondly, and most important, for the login URL field, this field is the oauth2 url. Therefore where before I was putting https://test.salesforce.com, I had to put https://test.salesforce.com/services/oauth2/token. With this final step, it worked. Below a screenshot of the field.

enter image description here

FVCC
  • 262
  • 2
  • 16