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
Lakshmi Kumar 7Lakshmi Kumar 7 

how to set salesforce 2FA to be API based rather than user interface based


I have created a new user in Salesforce for API integrations purpose. The username and password are tied to my credentials. Hence if anyone logs in from a different browser I get a verification code sent to my mobile as a text message. This user is created for developers to access Salesforce from other environments. 

I would like to know is there any other way to set up salesforce 2FA to be API based rather than user interface based? 

Which hopefully provides a programmatic way of using 2FA rather than relying on a text message method that requires user input – especially if this authentication has to happen in order to allow the website to properly access the API. My goal is to configure the API integration so it will programmatically happen instead of relying on user input (which would require someone like me to walk through the authentication process before the website would be able to communicate with Salesforce – potentially causing issues).

Please let me know what can be done here.

NagendraNagendra (Salesforce Developers) 
Hi Lakshmi,

Set Two-Factor Authentication Login Requirements for API Access


Hope this helps.