SOAP API is not able to authenticate using username/password+security only on sandboxes. I tried to authenticate the username/pwd+Security token using mavens mate and they seem to be correct.
Could this be due to TSL disablement? If so, what is the fix for this? I see fixes around using appropriate Java versions to support this change, but what should I do from Apex to allow SOAP logins?I am getting '
Web service callout failed: WebService returned a SOAP Fault: INVALID_LOGIN: Invalid username, password, security token; or user locked out. faultcode=INVALID_LOGIN faultactor=' exception which does not give any hint about the TLS disablement.
partnerSoapSforceCom.Soap con = new partnerSoapSforceCom.Soap();
partnerSoapSforceCom.LoginResult loginResult = con.login('username', 'passwordtoken');
Please note that it is happening only for sandboxes and not production. Any ideas, appreciated.
.login()
method? The URL for a sandbox org is test.salesforce.com and production is login.salesforce.com - if you are using auto-generated code, check the URL. – Mark Pond Mar 29 '17 at 1:07