I faced this issue when we were performing the stress test for the Organization. we took the help of a company which logs in and performs the stress test for different user scenarios.
This user needs to login from various browsers and IP ranges to perform the stress test and it was prompted for Two-Factor Authentication. As this is an automated test there was no way to enter the authentication code manually so we had to disable the Two-Factor Authentication for this user..
Below is the problem and solution in detailed steps, Please follow:
Problem : If the users want to get over the 2 factor authentication when they login from a new browser or new location.
Description : Users logging in to Salesforce from an unrecognized browser or device will be prompted to verify their identity as a security measure. This happens because the user often login from the various ip network ranges or clear the browser history and cache.
Solution : Expand the IP ranges for the users where they will be logging in to salesforce, so they are not asked for the 2 factor authentication.
Setup >> Network Access >> then enter the valid IP ranges.
Also add the ip ranges to the Profile of the users so they are not prompted to enter the 2 factor authentication.
- On the browser level, we need to change the browser settings to store the cookies related to salesforce sites. At the user level/ System edit the browser privacy settings. Google Chrome
- Click Settings.
- At the bottom, click Advanced.
- Select Privacy and Security | Content Settings | Cookies | Allow.
- Enter [*.]salesforce.com.
5.Click Allow. Internet Explorer
- Click Tools | select Internet Options.
- Select Privacy | Sites
- In the “Address of website” field, enter *. salesforce.com
- Click Allow.
- Click OK.
- Note : Before doing this, make sure we get the network security team approval.
-Sumanth A [03/08/2019]