forcedotcom / dataloader

Salesforce Data Loader
BSD 3-Clause "New" or "Revised" License
483 stars 293 forks source link

Sandbox OAuth login uses the wrong URL #1020

Closed jscottfras closed 7 months ago

jscottfras commented 7 months ago

Describe the bug When attempting to login to a Sandbox with OAuth, the URL in use is login.salesforce.com instead of test.salesforce.com. This prevents the login from proceeding successfully.

To Reproduce Steps to reproduce the behavior:

  1. Open Dataloader 60.0.2
  2. Click on 'Export'
  3. Select 'OAuth' from the radio buttons
  4. Select Sandbox from the 'Environment' picklist
  5. Complete the login on the browser window to a sandbox org (Notice that the login URL is incorrect for a sandbox org)
  6. Dataloader continues waiting for the browser to complete the login

Expected behavior After completing the login on the browser, dataloader verifies the login and allows you to continue

Screenshots image

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

ashitsalesforce commented 7 months ago

Go to Settings dialog and change Server host to "https://test.salesforce.com".

Screenshot 2024-03-13 at 5 03 33 PM

You will see the right URL when you try to login

Screenshot 2024-03-13 at 5 03 05 PM
jscottfras commented 7 months ago

Prior versions of data loader properly selected the correct URL based on the Environment selected. This is a regression.

Also, I updated the URL in the settings, and I'm still getting the login.salesforce.com URL. The only time the Server Host URL is used on my system is if you select Password Authentication.

Setting change: image

OAuth attempt: image

Password Auth attempt: image

jscottfras commented 7 months ago

This is a problem with the config file. I copied my config file from 59.0.0, and now it is working correctly.

I did not hand edit my config file previously, but updated the following setting corrects the issue: sfdc.oauth.Sandbox.server=https\://test.salesforce.com

ashitsalesforce commented 7 months ago

Hi @jscottfras , good to hear that you were able to identify the root-cause. The config.properties file shipped with data loader v60 has the entry sfdc.oauth.Sandbox.server=https\://test.salesforce.com/. So, it is a mystery as to why it changed to login.salesforce.com in your installation. Regardless, thanks for sharing your fix.