+ Start a Discussion
uri1981uri1981 

User cannot log-in through API

Hi there
I have created 2 SSP users, that seem to have the same properties.
Manually, via the regular web console, i succeed to log-in with both users.
 
But when i try to log in using the APEX api (using the sample c# program), only one of them succeeds to log in. I tried to reset password, and even to re-create the second user. but it won't log in.
The error i get:

"INVALID_LOGIN: Invalid username or password or locked out."

 
What's the difference between the 2 log in methods? (API call VS. web console)
Both users are active, of course.
 
Attached a snapshot with the users' details.
 
 
uri1981uri1981

I would like to add some information:

I tried to use this API through a new web application i wrote, written in C#/ASP.NET.

I get the same problem when trying to log-in.

One user can log in, the other one cannot. Is there any data  should be added to the HttpRequest (binding request) in order to log in correctly?

 

This is the code that is used, that succeeds to log in with one user, but doesn't succeed with another.

Code:

 public static bool ValidateCredentialAgainstSalesForce(string username, string password, out string SFID, out string SFEmail)
        {
            SforceService binding = null;
            LoginResult loginResult = null;

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

            SFID = ""; SFEmail = "";

            try
            {
                loginResult = binding.login(username, password);
            }
            catch (System.Web.Services.Protocols.SoapException e)
            {
                // This is likley to be caused by bad username or password
                return false;
            }
            catch (Exception e)
            {
                // This is something else, probably comminication
                return false;
            }

            /*binding.Url = loginResult.serverUrl;

            //Create a new session header object and set the session id to that returned by the login
            binding.SessionHeaderValue = new SFpartner.SessionHeader();
            binding.SessionHeaderValue.sessionId = loginResult.sessionId;*/

            SFID = loginResult.userId;
            SFEmail = loginResult.userInfo.userEmail;

            return true;    
        }


 

Ron HessRon Hess
Self service users are not valid users of the API.

I would expect that each and every self-service portal user cannot login to the api.
saariko.ax241saariko.ax241
Hi Ron,

You maybe right, but according to Uri, he has one SSP user that the API is giving him a successful connection.

Uri,
Can you post maybe the login procedure you get from the SSP user that is able to connect?

   
uri1981uri1981
Saar is correct.
See the attached snapshot: this is the login procedure i get when i login using an SSP user!