pythonpython-3.xsalesforce-lightningsimple-salesforce

Python to access Salesforce MFA in simple-salesforce


I am currently using the simple-salesforce package in python to retrieve report from Salesforce. But im getting below error msg:

SalesforceAuthenticationFailed SalesforceAuthenticationFailed: INVALID_SSO_GATEWAY_URL: the single sign on gateway url for the org is invalid

below is my code which i used in python to access Salesforce(with multi factor Authenticator enabled)

from simple_salesforce import Salesforce

sf = Salesforce(username='orgmailid@example.com', password='password', security_token='token')

which is not working, Any help will be appreciated. Could anyone please let me kow how to access salesforce with MFA enabled and when i run my python code, it should ask for multi factor authentication.


Solution

  • The simple-salesforce package, to my knowledge, does not natively support MFA in the way you're hoping. You can look this up https://salesforce.stackexchange.com/a/334782