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
jortjort 

INVALID_LOGIN

New to salesforce, SOAP and web services, so not surprising that I'm stuck @ the gate on login.  Created a Developer account, followed instructions for getting WSDL files, and using soapUI (seems to be a great tool BTW!) to generate SOAP messages for login.  Using the same username and password that I can successfully use on the salesforce website, cut and paste my organizationId from the site, and appended the security token from the email to my password. 

Based on what I read somewhere, I left the tags for client, defaultNamespace and portalId empty.

Here's what I post (edited for the ID, username, etc.) - this is trying to use the Partner wsdl - get same error for Enterprise:

 

POST https://login.salesforce.com/services/Soap/u/19.0 HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: ""
User-Agent: Jakarta Commons-HttpClient/3.1
Host: login.salesforce.com
Content-Length: 715

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:partner.soap.sforce.com">
   <soapenv:Header>
      <urn:CallOptions>
         <urn:client></urn:client>
         <urn:defaultNamespace></urn:defaultNamespace>
      </urn:CallOptions>
      <urn:LoginScopeHeader>
         <urn:organizationId>00D50000000xxxx</urn:organizationId>
         <!--Optional:-->
         <urn:portalId></urn:portalId>
      </urn:LoginScopeHeader>
   </soapenv:Header>
   <soapenv:Body>
      <urn:login>
         <urn:username>jort@xxxxxxxxxxxxx.com</urn:username>
         <urn:password>pppppppppp78l6g7iFac5uaviDnJLFxxxxx</urn:password>
      </urn:login>
   </soapenv:Body>
</soapenv:Envelope>

 

and the response:

 

HTTP/1.1 500 Internal Server Error
Server:
Content-Encoding: gzip
Content-Type: text/xml; charset=utf-8
Content-Length: 351
Date: Thu, 01 Jul 2010 14:03:03 GMT

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><soapenv:Fault><faultcode>sf:INVALID_LOGIN</faultcode><faultstring>INVALID_LOGIN: Invalid username or password, locked out or Self-Service portal is not enabled</faultstring><detail><sf:LoginFault xsi:type="sf:LoginFault"><sf:exceptionCode>INVALID_LOGIN</sf:exceptionCode><sf:exceptionMessage>Invalid username or password, locked out or Self-Service portal is not enabled</sf:exceptionMessage></sf:LoginFault></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>

 

This newbie thanks you in advance for any and all help you can give!

Best Answer chosen by Admin (Salesforce Developers) 
SuperfellSuperfell

Take out the LoginScopeHeader, thats for self service & portal logins only.

All Answers

SuperfellSuperfell

Take out the LoginScopeHeader, thats for self service & portal logins only.

This was selected as the best answer
jortjort

Ah!  That did it!!  Thank you VERY much!

é1000é1000

No luck for me. Same problem here :-(

 

 

soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com">
   <soapenv:Header>
      <urn:CallOptions>
         <urn:client></urn:client>
         <urn:defaultNamespace></urn:defaultNamespace>
      </urn:CallOptions>
      
   </soapenv:Header>
   <soapenv:Body>
      <urn:login>
         <urn:username>blahblahbalh</urn:username>
         <urn:password>xxxxxxxxxxxxxxxxxx</urn:password>
      </urn:login>
   </soapenv:Body>
</soapenv:Envelope>

 

soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com">   <soapenv:Header>      <urn:CallOptions>         <urn:client></urn:client>         <urn:defaultNamespace></urn:defaultNamespace>      </urn:CallOptions>         </soapenv:Header>   <soapenv:Body>      <urn:login>         <urn:username>kcoeim@kone.com</urn:username>         <urn:password>8xS0*!dFIu4zvS6toJMVkusdom2xKHDy</urn:password>      </urn:login>   </soapenv:Body></soapenv:Envelope>

 

Repsonse invariably:

 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

   <soapenv:Body>

      <soapenv:Fault>

         <faultcode>INVALID_LOGIN</faultcode>

         <faultstring>INVALID_LOGIN: Invalid username, password, security token; or user locked out.</faultstring>

         <detail>

            <sf:LoginFault xsi:type="sf:LoginFault">

               <sf:exceptionCode>INVALID_LOGIN</sf:exceptionCode>

               <sf:exceptionMessage>Invalid username, password, security token; or user locked out.</sf:exceptionMessage>

            </sf:LoginFault>

         </detail>

      </soapenv:Fault>

   </soapenv:Body>

</soapenv:Envelope>

 

CreatobugCreatobug

Thank you :). This helped me too 

Bruno DiazBruno Diaz
Thanks works for me too!
Baharul Islam 10Baharul Islam 10
Hi All,

I am trying to loginSFDC wsdl from soupUI but getting below error.Can someone please help on this.

Request XML
-----------------
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:partner.soap.sforce.com">
   <soapenv:Header>
      <urn:CallOptions>
         <urn:client></urn:client>
         <urn:defaultNamespace></urn:defaultNamespace>
      </urn:CallOptions>     
   </soapenv:Header>
   <soapenv:Body>
      <urn:login>
         <urn:username>bmazumder012@gmail.com</urn:username>
         <urn:password>rMQoRm55JqzNe659wD75BIgUr</urn:password>
      </urn:login>
   </soapenv:Body>
</soapenv:Envelope>

Response
-------------------
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <soapenv:Fault>
         <faultcode>sf:INVALID_LOGIN</faultcode>
         <faultstring>INVALID_LOGIN: Invalid username, password, security token; or user locked out.</faultstring>
         <detail>
            <sf:LoginFault xsi:type="sf:LoginFault">
               <sf:exceptionCode>INVALID_LOGIN</sf:exceptionCode>
               <sf:exceptionMessage>Invalid username, password, security token; or user locked out.</sf:exceptionMessage>
            </sf:LoginFault>
         </detail>
      </soapenv:Fault>
   </soapenv:Body>
</soapenv:Envelope>


I am able to login from browser.
Jose Soto HHJose Soto HH
Baharul, it seems like you might be using the token or password alone for the password field. For the API, you will need to concatenate the password and the token for that field.
WIN LAE AYEWIN LAE AYE
I removed LoginScopeHeader and also put password + security token together in <urn:password> as the following. 

Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com">
   <soapenv:Header>
   </soapenv:Header>
   <soapenv:Body>
      <urn:login>
         <urn:username>*******@trailhead.com</urn:username>
         <urn:password>*******flBOuiaflFepku1Gd1uqXAA6</urn:password>
      </urn:login>
   </soapenv:Body>
</soapenv:Envelope>

But, unfortunately, I got the following error message. I can't login. Please could you help me?? :(

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <soapenv:Fault>
         <faultcode>sf:INVALID_LOGIN</faultcode>
         <faultstring>INVALID_LOGIN: ユーザ名、パスワード、セキュリティトークンが無効か、ユーザがロックされています。</faultstring>
         <detail>
            <sf:LoginFault xsi:type="sf:LoginFault">
               <sf:exceptionCode>INVALID_LOGIN</sf:exceptionCode>
               <sf:exceptionMessage>ユーザ名、パスワード、セキュリティトークンが無効か、ユーザがロックされています。</sf:exceptionMessage>
            </sf:LoginFault>
         </detail>
      </soapenv:Fault>
   </soapenv:Body>
</soapenv:Envelope>
 
Ana NetoAna Neto
Just to add that I was having trouble getting my Security Token. Then I realized I was using Lightning experie nce. I switched to Classic, found the Reset My Security Token and put the token right next to the password and it worked.
nidhusha rachamadugunidhusha rachamadugu

Superfell
Take out the LoginScopeHeader, thats for self service & portal logins only.
------------------------------------------------------------------
This worked for me..Thanks ...
 
MizalqMizalq

Hello, this post was started a long time ago however I feel like this could help a lot of people.

  • If you've already eliminated the <urn: LoginScopeHeader> </urn: LoginScopeHeader> elements and everything inside them.
  • If you are certain you are inputing the right values in:

<urn:username>yourOrgUserMail</urn:username> and

<urn:password>yourPasswordYourSecurityToken</urn:password>    , example -> <urn:password>pass123Token123</urn:password> (literally copy and paste your security token right after your password)

  • If you can login through login.salesforce.com


After being certain of those 3 "if's" and you are still getting INVALID_LOGIN, the problem is in the order you reset your password and token. In other words, if you've reset the security token and only after you've reset the password, you won't be able to login. 

SOLUTION: Reset your password first and only after reset your security token

I'm confident this is the solution for everyone desperate to find it through the web.

Hope I've helped :) you may send a "thank you" by Liking my comment.

Mizalq

Jeffrey EhrhartJeffrey Ehrhart
I was experiencing difficulty getting my Security Token. Then, at that point, I understood I was utilizing Lightning experie nce. I changed to Classic, found the Reset My Security Token and put the symbolic right close to the secret key and it worked.You can try this source (https://loginhulk.com/) for helping in login at different webportals.