Sub topic 2
What MFA is and why Salesforce requires it
This chapter assumes you can navigate Setup, know the difference between profiles and permission sets, and have read the previous chapter on how Salesforce authenticates users and what attackers target. Here you will build the working model of multi-factor authentication (MFA) and learn what the Salesforce requirement means in practice.
What MFA is
Multi-factor authentication is a login method that asks for two or more independent pieces of proof that you are who you claim to be. Each piece of proof is called a factor. Factors fall into three categories:
| Category | What it is | Examples |
|---|---|---|
| Knowledge | Something you know | Password, PIN |
| Possession | Something you have | Phone with an authenticator app, security key |
| Inherent | Something you are | Fingerprint, face scan |
Two factors from the same category do not count as MFA. A password plus a security question is two knowledge factors. An attacker who can phish one can usually phish the other. Real MFA combines categories. The common Salesforce pattern is a password (knowledge) plus a verification method on a device the user holds (possession). Built-in authenticators, such as a fingerprint reader on a laptop, add the inherent category because the device unlocks the credential with a biometric.
Salesforce uses the term verification method for the second factor. The next chapter compares the methods in detail. For now, treat a verification method as anything the user registers that can later prove possession of a trusted device.
Why a password alone is not enough
Passwords fail in predictable ways. Users reuse them across sites. Attackers buy leaked credential lists and try them against many services, which is called credential stuffing. Phishing pages copy the Salesforce login screen and capture whatever the user types. Malware on a laptop can record keystrokes.
In every one of these cases, the attacker ends up holding a valid username and password. With a password-only login, that is enough to get in. With MFA, the attacker still needs the second factor, which lives on a device the attacker does not control. The stolen password alone becomes close to useless.
Salesforce orgs hold customer records, contracts, pipeline data, and often integrations into other systems. One compromised account can expose a large amount of data, and the account's permissions determine how much. MFA reduces that risk at the single point where it matters most, the moment of login.
The Salesforce MFA requirement
Salesforce requires MFA for all direct logins to Salesforce products. This is a contractual requirement in the Salesforce Terms of Service, not only a recommended setting. Customers must ensure that every user signing in to a Salesforce product through the Salesforce login page uses MFA.
There are two ways to meet the requirement:
- Enable MFA directly in Salesforce. Users log in with a username and password, then prove possession of a registered verification method.
- Use single sign-on (SSO) with MFA at the identity provider. Users authenticate at your identity provider, such as Okta or Microsoft Entra ID, and the provider enforces MFA before it passes the login to Salesforce.
Both approaches satisfy the requirement. What does not satisfy it is a password-only login that bypasses both. SSO logins are covered in a later chapter. Check the current Salesforce documentation for the exact wording and scope of the requirement, because the details of enforcement and supported products have been updated over time.
How the MFA login flow works
The flow adds one step after the password check. The diagram shows the sequence for a user who has already registered a verification method.
Three points about this flow are worth remembering.
- The password is checked first. A wrong password stops the flow before any challenge is sent. A correct password with a failed or missing second factor also stops the flow, and no session is created.
- The challenge depends on the method. Salesforce Authenticator sends a push approval. A time-based one-time password (TOTP) app shows a code that the user types in. A security key requires a physical touch.
- A session is created only after both steps succeed. After that, session settings, covered in a later chapter, control how long the session lasts.
Where MFA is enforced and where it is not
Understanding the boundary of enforcement prevents surprises during a rollout.
| Login path | Does Salesforce MFA apply? | Notes |
|---|---|---|
| Direct login on the Salesforce login page | Yes, when enabled for the user | The main case the requirement covers |
| SSO through an identity provider | Handled by the identity provider | Salesforce can also be told to trust or require the provider's MFA result |
| API login with a username and password | Not as an interactive challenge | Needs a separate design, such as an OAuth-based flow |
| Mobile app login | Yes, same as direct login | Registration can happen on first login |
The practical consequence is that "MFA is on" is not a single switch with a single meaning. You have to check each path users and systems take into your org.
Two ways to turn it on
Salesforce offers more than one mechanism, and they differ in how they scope the change.
- A permission set or profile permission. You grant the Multi-Factor Authentication for User Interface Logins permission to the users who should be challenged. A permission set lets you start with a pilot group. A profile setting is a broader sweep.
- Identity verification at the org level. Salesforce also uses its own risk-based checks, such as verifying a login from an unrecognized browser or location. This is not the same as MFA. It is a lighter check on top of the password and does not replace the requirement.
The next chapters cover the verification methods and the exact steps. At this stage the key decision is scope. You can enable MFA for everyone at once, or you can enable it by group and measure the effects. The final chapter in this tutorial, on rollout, returns to that choice.
Common errors and misconceptions
- "A strong password policy replaces MFA." It does not. A long, complex password still fails to phishing and credential reuse. Password policies, covered later, reduce risk but do not remove the need for a second factor.
- "MFA is on because SSO is on." Only if the identity provider actually enforces MFA. If the provider accepts a password alone, users reach Salesforce with one factor.
- "Enabling the permission registers the user." Enabling the permission only makes Salesforce require MFA. Each user must still register a verification method at their next login. A user who never registers cannot complete the challenge.
- "SMS codes count as the best option." Salesforce does not list text messages among its standard verification methods, because phone numbers can be hijacked through SIM swapping. Prefer the supported methods the next chapter describes.
- "Admins are exempt." Administrators are the highest-value targets because of their permissions. They should be among the first people enrolled.
Checking who has registered
After you enable MFA, you will want to know who has not yet registered a method. The TwoFactorInfo object records registered verification methods per user. This query lists active users with no record in it.
SELECT Id, Name, Username
FROM User
WHERE IsActive = true
AND Id NOT IN (SELECT UserId FROM TwoFactorInfo)Run it in Developer Console or Workbench. Each row is a person who still needs to register. Two things to keep in mind. First, integration users appear in this list if they are active, and they usually should not be treated as people who need to register an authenticator app. Second, the result is a snapshot, so rerun it as the rollout proceeds.
Exercises
Exercise
A user has a username, a password, and a security question. Does logging in with all three count as MFA? Explain why or why not.
Show answer
No. The password and the security answer are both knowledge factors, so they come from the same category. MFA requires factors from different categories, such as a password (knowledge) plus a device the user holds (possession).
Exercise
Your company signs in to Salesforce through an identity provider. A colleague says the Salesforce MFA requirement is therefore met automatically. What do you need to check before agreeing?
Show answer
Check that the identity provider enforces MFA for the Salesforce login. SSO satisfies the requirement only if the provider challenges users for a second factor before passing the login to Salesforce. If the provider accepts a password alone, the login still uses one factor.
Exercise
You enabled the MFA permission for a pilot group yesterday. Which query helps you find pilot users who have not yet registered a method, and what should you exclude from the list?
Show answer
Query active users whose Id is not in the UserId values of TwoFactorInfo. Exclude integration users, because they are not people who register authenticator apps.