+ Start a Discussion

Sandbox URL + "INVALID_LOGIN: Invalid username, password, security token; or user locked out."

Hello All,


 I tried connecting to SalesForce sandbox URL from visual studio through API and i got the follownig error. "INVALID_LOGIN: Invalid username, password, security token; or user locked out."


Logged into the sandbox url and downloaded the "enterprise.wsdl.xml"

Added the webreference for the above .wsdl file. and used the following code to login.



LoginResult lr;
                SforceService binding = new SforceService();
                binding.Timeout = 60000;

                //binding.Url = "https://test.salesforce.com/services/Soap/c/24.0/0DFC00000004hw6";
                lr = binding.login("<username>", "<password>"" + "<Securitytoken>");



I checked the .wsdl file and it is referring to the "https://test.salesforce.com/services/Soap/c/24.0/0DFC00000004hw6" address.


With the credentials provided for login method i am able to login to the SalesForce sandbox URL.

Trying to get this thing working for 1 week.


But i have another developer account, after downloading enterprise wsdl from that account i was able to sucessfully login and fetch data from salesforce.I used the same approach . Not able to find out the difference.


This sandbox account was given to me by my client, i got the security token also from them.

  • Does this involve any security setting to allow API access from different regions?
  • i saw an article which says "You'll need to login with the .test version of the username, or change the username to not have the .test in it." What does this mean? Reference

Can anyone guide me in getting this done? Thanks in advance.






Why dont you reset your password which will get you a new pass and new security token. That might help.


For your 2nd question, Example,


If you have a user name called sriram@client.com in production, then when a sandbox is refreshed your account gets created with the following username sriram@client.com.sandboxname