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
Chintan-StringsChintan-Strings 

Loggin into Sales Force Production via API

We are trying to Login via API (C#) code, its displaying "INVALID_LOGIN: Invalid username, password, security token; or user locked out." message.

We created SandBox in the past and used to login and develop via API, it worked, but login in Production Environment is not working.

I checked username/password/security token, it all looks fine, the API is also enabled for user profile. Please help.
Best Answer chosen by Admin (Salesforce Developers) 
SuperfellSuperfell
It sounds like your login request is probably still going to sandbox, and not to the production servers. check to see what the Url property of your stub object is just before you call login.

All Answers

SuperfellSuperfell
What does login history say ?
Chintan-StringsChintan-Strings

Thanks Simon for reply.

 

I looked at History, and there is no log entry for my login, that means its not even checking the Login for this site.

 

Before this, I was developing against SandBox, it was working fine and now I want to develop this against Production Sales Force. For this I just downloaded Production wsdl file imported it in my project and changed Logins for Production.

 

I have no idea.  

SuperfellSuperfell
It sounds like your login request is probably still going to sandbox, and not to the production servers. check to see what the Url property of your stub object is just before you call login.
This was selected as the best answer
Chintan-StringsChintan-Strings
Hi Simon, I just found out that its still checking Logins against SandBox Environment. What is the main thing for Sales Force Logic in deciding what site to test against? Is it by username? 
Chintan-StringsChintan-Strings

You are absolutely correct, its still checking against Sand box.....I think I will have to Re Import wsdl file from Production.

What do you think? 

SuperfellSuperfell
You might also be picking up the Url from a config file.