function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
JP Nikko AM SystemsJP Nikko AM Systems 

Cannot login to data loader through command line

Hi ,

I'm creating a batch file to import data through data loader cli. However, I can't seem to login. I get INVALID_Login exception. I can login through the UI but not through the command line.
We're using a domain to login and I use the OAuth option when logging in through the UI(somehow Password Authentication doesn't work) because of the 3rd party SSO we setup for Salesforce.
Narender Singh(Nads)Narender Singh(Nads)

Hi ,
To log into Data loader, your login password is not just your password.
In order to login into Data Loader, your password will be concatenation of your password and the security token.
To get the security for your org, go to my settings by clicking the your name. Go to personal information. Click reset my security token. Your security token will be emailed to you. 
Your login password will be then: your password+security token.
 
Use this concantenated password to login into dataloader.

Let me know if it helps.
Thanks

JP Nikko AM SystemsJP Nikko AM Systems
Hi,

I tried to add the security token , then encrypted the whole password. BUt now I get below error.
It doesn't even show in the Login History in Salesforce.
Tried everything even added the Proxy settings but no luck. Please advise.


2018-06-06 11:31:17,998 ERROR [contactInsert] client.PartnerClient runOperation
(PartnerClient.java:332) - Error while calling web service operation: login, err
or was: Failed to send request to https://login.salesforce.com/services/Soap/u/4
2.0
com.sforce.ws.ConnectionException: Failed to send request to https://login.sales
force.com/services/Soap/u/42.0
        at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:121)
        at com.sforce.soap.partner.PartnerConnection.login(PartnerConnection.jav
a:818)
        at com.salesforce.dataloader.client.PartnerClient$8.run(PartnerClient.ja
va:161)
        at com.salesforce.dataloader.client.PartnerClient$8.run(PartnerClient.ja
va:152)
        at com.salesforce.dataloader.client.PartnerClient.runOperation(PartnerCl
ient.java:328)
        at com.salesforce.dataloader.client.PartnerClient.loginInternal(PartnerC
lient.java:524)
        at com.salesforce.dataloader.client.PartnerClient.login(PartnerClient.ja
va:492)
        at com.salesforce.dataloader.client.PartnerClient.connect(PartnerClient.
java:213)
        at com.salesforce.dataloader.controller.Controller.login(Controller.java
:173)
        at com.salesforce.dataloader.controller.Controller.login(Controller.java
:168)
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.jav
a:128)
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.jav
a:100)
        at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.ja
va:253)
Caused by: org.apache.http.conn.HttpHostConnectException: Connect to login.sales
force.com:443 [login.salesforce.com/101.53.160.2, login.salesforce.com/101.53.16
0.130, login.salesforce.com/101.53.161.130] failed: Connection timed out: connec
t
        at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect
(DefaultHttpClientConnectionOperator.java:158)
        at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(
PoolingHttpClientConnectionManager.java:353)
        at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClie
ntExec.java:380)
        at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.
java:236)
        at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java
:184)
        at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
        at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java
:110)
        at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttp
Client.java:184)
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttp
Client.java:82)
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttp
Client.java:107)
        at com.salesforce.dataloader.client.HttpClientTransport.getContent(HttpC
lientTransport.java:133)
        at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:97)
        ... 12 more
 
JP Nikko AM SystemsJP Nikko AM Systems
Yes, I've been following those steps but I can't make it work.
However, it's now showing in Login history as

Other Apex APIInvalid PasswordN/A
Password is correct though.
 
Narender Singh(Nads)Narender Singh(Nads)
Are you using the combination of password and securitytoken as the final password.
For example, if:
Password: nikko
Securitytoken: asuIAausfuigfixzfvsf 

Then the final password will be:nikkoasuIAausfuigfixzfvsf 

Also please make sure you are using correct security token for that username. Please note that security token for every user in the org is different.
Narender Singh(Nads)Narender Singh(Nads)
Password: nikko
Securitytoken: asuIAausfuigfixzfvsf
Encrypted password: iwehrifdsjZ
A Correction:
Then the final password will be:iwehrifdsjZasuIAausfuigfixzfvsf 
JP Nikko AM SystemsJP Nikko AM Systems
Hi,
I've tried everything with the password combination. It is correct. but still giving an invalid_login exception.
Narender Singh(Nads)Narender Singh(Nads)
Hi,
A quick question, Is it showing in the login history?
Also, which domain are you using to login. If you are using login.salesforce.com and you have a custom domain set up for your org then try using using your custom domain url instead of login.salesforce.com

Let me know if it works out for you.
JP Nikko AM SystemsJP Nikko AM Systems
Hi,
Thanks for your reply.
I tried that but it's giving same error.
Also SF has gotten back to us that it won't work for SSO enabled ID,but we can't create a new ID just for this. and also a non-admin user wll be the one to execute the batch. Any other workaround? 
https://success.salesforce.com/ideaView?id=08730000000i1GCAAY
 
Narender Singh(Nads)Narender Singh(Nads)
Ohh, I wasn't aware of this limitation.
Though in the idea link you shared, the latest comment(by Casey Shockley)  says : "40.0.0 works for me with SSO. I have not seen this issue come up in the most recent versions."