API Basics->Use SOAP API Unit: SoapUI Invalid Login: Invalid Username, password, security Token... - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Adam DunnAdam Dunn 

API Basics->Use SOAP API Unit: SoapUI Invalid Login: Invalid Username, password, security Token...

Been trying to complete the module API Basics->Use SOAP API, but I am unable to login through SoapUI. My login request is the same as that in the module and my username and password are correct as of trying to log in through a browser. My security token is up to date as I have reset it 2 times to make sure that I have the most current one.

The username is the same as the one that shows up in the reset token email, so I know that I am matching the right token to the right account.

User-added image

Error returned:
User-added image
Best Answer chosen by Adam Dunn
Narender SinghNarender Singh
Are you using a colon ':' while substituting your actual username?
If yes, then remove it.

Example:
Username: abc@qwe.com
Password: 123
Sec Token:oiaugfojkbfnsaugH

Then it should look like this:
<urn:username>abc@qwe.com</urn:username>
<urn:password>123oiaugfojkbfnsaugH</urn:password>

All Answers

Narender SinghNarender Singh
Hi Adam,

Are you able to login into that org using the normal login process?
Adam DunnAdam Dunn
Hi Narender,

I am able to sign into the trailhead org using the salesforce login with those credentials. 

I've done some looking, and on the "users" page of the account I am trying to log into, my SoapUI login requests are not popping up in the User Login History section. I'm not sure if these types of calls from SoapUI normally show up in the login history, but I thought it might be something to add in order to help.
Narender SinghNarender Singh
Did you create a project and import the WSDL file? If it's successfully imported, in the left pane you should get something like this:

User-added image

Now find 'Login' as shown and make sure your body looks like this.
User-added image
Adam DunnAdam Dunn
Yep, I generated the wsdl file from the salesforce org I am using as per the module's instructions. The file is saved as *.xml, is that correct?
The left pane is there for me exaclty as your's is. My body, as shown in the screenshot, looks the same as you've shown, and my url is the same, as shown in my initial post.
Here is my full screen:
User-added image
 
Narender SinghNarender Singh
Are you using a colon ':' while substituting your actual username?
If yes, then remove it.

Example:
Username: abc@qwe.com
Password: 123
Sec Token:oiaugfojkbfnsaugH

Then it should look like this:
<urn:username>abc@qwe.com</urn:username>
<urn:password>123oiaugfojkbfnsaugH</urn:password>
This was selected as the best answer
Marija BerzinsMarija Berzins
I was able to reset my pwd. Confirms it works..... ,but still failing on this challenege. 
<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: 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>

My code
<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>tberzins@playful-fox-7niduj.com</urn:username>
         <urn:password>MYPASSWORDZyj8NVdv0ZCdH5OXoDgp0qr0V</urn:password>
      </urn:login>
   </soapenv:Body>
</soapenv:Envelope>  MYPASSWORD is not show here, but I am using my real password.
Randal PintoRandal Pinto
Hey everyone, banged my head for a couple of hours to find a solution so thought I should share. It seems that if you have previously created a password and security token then go on to generate the WSDL file this password will not give you access to the SOAP API. You have to reset both the password and the security token (in this order) to grant that user access to SOAP APIs.
Miguel AlbuquerqueMiguel Albuquerque
Hello, this post was started some 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