For each profile, you can allow the use of a time-based token to access the service instead of the standard security token. If users add a time-based token to their account and this permission is enabled, they must use this token instead of the standard security token whenever it’s requested, such as when resetting the account’s password. See Using Time-Based Tokens to Access the API.
Login IP Address Ranges
For each profile, you can set the IP addresses from which users can log in. See:
When users log in to Salesforce, either via the user interface, the API, or a desktop client such as Connect for Outlook, Salesforce for Outlook, Connect Offline, Connect for Office, Connect for Lotus Notes, or the Data Loader, Salesforce confirms that the login is authorized as follows:
Salesforce checks whether the user’s profile has login hour restrictions. If login hour restrictions are specified for the user’s profile, any login outside the specified hours is denied.
If the user has the “Two-Factor Authentication for User Interface Logins” permission, Salesforce prompts the user for a time-based token (which the user may also be prompted to create if it hasn’t already been added to the account) upon logging in.
If the user has the “Two-Factor Authentication for API Logins” permission and a time-based token has been added to the account, Salesforce returns an error if a time-based token is not used to access the service in place of the standard security token.
Salesforce then checks whether the user’s profile has IP address restrictions. If IP address restrictions are defined for the user’s profile, any login from an undesignated IP address is denied, and any login from a specified IP address is allowed.
If profile-based IP address restrictions are not set, Salesforce checks whether the user is logging in from an IP address they have not used to access Salesforce before:
If the user’s login is from a browser that includes a Salesforce cookie, the login is allowed. The browser will have the Salesforce cookie if the user has previously used that browser to log in to Salesforce, and has not cleared the browser cookies.
If the user’s login is from an IP address in your organization’s trusted IP address list, the login is allowed.
If the user’s login is from neither a trusted IP address nor a browser with a Salesforce cookie, the login is blocked.
Whenever a login is blocked or returns an API login fault, Salesforce must verify the user’s identity:
For access via the user interface, the user is prompted toenter a token (also called a verification code) to confirm the user’s identity.
Users aren’t asked for a verification code the first time they log in to Salesforce.
For access via the API or a client, users must add their security token (or time-based token if Two-Factor Authentication on API Logins is set on the user’s profile and the user has added a time-based token to his or her account) to the end of their password in order to log in.
A security token is an automatically-generated key from Salesforce. For example, if a user’s password is mypassword, and the security token is XXXXXXXXXX, then the user must enter mypasswordXXXXXXXXXX to log in.
Users can obtain their security token by changing their password or resetting their security token via the Salesforce user interface. When a user changes their password or resets their security token, Salesforce sends a new security token to the email address on the user’s Salesforce record. The security token is valid until a user resets their security token, changes their password, or has their password reset.
We recommend that you obtain your security token using the Salesforce user interface from a trusted network prior to attempting to access Salesforce from a new IP address.
Tips on Setting Login Restrictions
Consider the following when setting login restrictions:
When a user’s password is changed, the security token is automatically reset. The user may experience a blocked login until he or she adds the automatically-generated security token to the end of his or her password when logging in to Salesforce via the API or a client.
Partner Portal and Customer Portal users aren’t required to activate computers to log in.
If single sign-on is enabled for your organization, API and desktop client users can’t log into Salesforce unless their IP address is included on your organization’s list of trusted IP addresses or on their profile, if their profile has IP address restrictions set. Futhermore, the single sign-on authority usually handles login lockout policies for users with the “Is Single Sign-On Enabled” permission. However, if the security token is enabled for your organization, then your organization’s login lockout settings determine the number of times a user can attempt to log in with an invalid security token before being locked out of Salesforce.
These events count toward the number of times a user can attempt to log in with an invalid password before being locked out of Salesforce, as defined in your organization’s login lockout settings:
Each time a user is prompted to confirm his or her identity (when a user clicks Email me a verification code for example)
Each time a user incorrectly adds the security token or time-based token to the end of their password to log into the API or a client