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
Cal PatersonCal Paterson 

Sometimes I can log in via API, sometimes I can't.

It's bizarre. I'm using Pythons simple-salesforce module. Everything worked fine for months.

Today however, sometimes, my requests go through fine. Other times, I get a:

SalesforceAuthenticationFailed: INVALID_LOGIN: Invalid username, password, security token; or user locked out.

I've reset my token, refreshed my sandbox, tried connecting to both production and test - always the same outcome.

Every 10+ requests fail, then 1 goes through.

I feel this is definitely an issue with Salesforce, but have no idea how to get through to them.

Any help much appreciated.
Gaurav KheterpalGaurav Kheterpal
It's a problem with your security token. To reset it, follow these steps

At the top of any Salesforce page, click the down arrow next to your name. From the menu under your name, select Setup or My Settings—whichever one appears.
From the left pane, select one of the following:

If you clicked Setup, select My Personal Information | Reset My Security Token.
If you clicked My Settings, select Personal | Reset My Security Token.

Click the Reset Security Token button. The new security token is sent via email to the email address on your Salesforce user record.

You can then login using the Python module in a manner like this
 
from simple_salesforce import Salesforce
sf = Salesforce(username='nick@nickcatalano.com', password='nickspassword', security_token='tokenemailedtonick')

If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others and improve the overall quality of Discussion Forums.

Gaurav Kheterpal
Certified Force.com Developer| Salesforce Mobile Evangelist| Developer Forums Moderator| Dreamforce Speaker

 
Cal PatersonCal Paterson
Hi Guarav,

Thank's for your swift response, however you seem to have mis-read my question.

I already mentioned that I've reset my token.

Any other suggestions?
Gaurav KheterpalGaurav Kheterpal
My bad, I missed that. Are you logging in from the same public IP each time?

This (http://stackoverflow.com/questions/25130278/python-simple-salesforce) is a thread where the author of this module responded to a similar question. I hope this helps.

If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others and improve the overall quality of Discussion Forums.

Gaurav Kheterpal
Certified Force.com Developer| Salesforce Mobile Evangelist| Developer Forums Moderator| Dreamforce Speaker
ThimoThimo
Does anyone have a solution on this?