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
adamproadampro 

Using Beatbox in Python to Login to Salesforce

Hi,

 

I'm trying to use Beatbox because I have to utilize the metadata WSDL file for what I'm trying to accomplish but right now I'm having trouble even getting started. Right now, it's not even allowing me to login. This is the code I'm using, direct from the Beatbox page: 

 

sf = beatbox._tPartnerNS
svc = beatbox.Client()
svc.login(username@gmail.com, PasswordwithSecurityTokenAppended)

 

First I tried using GetPass to enter my password but that kept returning me an error so I decided to scrap that and just try entering my Password+security token directly into the code. Of course, this time it's returning me a different error. 

 

File "build/bdist.macosx-10.6-intel/egg/beatbox.py", line 55, in login
    lr = LoginRequest(self.serverUrl, username, password).post()
  File "build/bdist.macosx-10.6-intel/egg/beatbox.py", line 307, in post
    raise SoapFaultError(faultCode, faultString)
SoapFaultError: 'INVALID_LOGIN' 'INVALID_LOGIN: Invalid username, password, security token; or user locked out.'

 

I know for certain that my username, password, and security token for my Dev account are all correct. Does anyone know what is wrong and/or how I can go about fixing this?

 

Thanks!

Best Answer chosen by Admin (Salesforce Developers) 
SuperfellSuperfell

sounds like you might be using sandbox credentials, but haven't changed the server Url to point to test.salesforce.com. Have you looked in login history, does that show your login attempt ?

All Answers

SuperfellSuperfell

sounds like you might be using sandbox credentials, but haven't changed the server Url to point to test.salesforce.com. Have you looked in login history, does that show your login attempt ?

This was selected as the best answer
adamproadampro

I forgot I could check my login history. I just checked it and I see the login attempts but it says I used an invalid password, which I know is not the case. The password is supposed to have the security token appended to the end of it, correct?

 

Thanks!

SuperfellSuperfell

correct. do you have the right security token?

adamproadampro

Looks like I was using an old security token. Thanks for the help!