Sub topic 5
Registering a verification method
This chapter assumes you can navigate Setup, assign permission sets, and already know which verification methods your org allows. It covers what users see when they register, how admins confirm registration, and the errors that come up most often.
What registration does
Turning on MFA does not register anyone. Registration is the step where a user links a verification method to their own account. Until a user completes it, Salesforce has nothing to check at login. At the next login after MFA is required, the user is sent to a registration screen and cannot continue without finishing it.
A user can register more than one method. You should encourage this, because a second method is the simplest recovery path if a phone is lost.
The user's registration flow
The exact screens differ by method, but the sequence is the same.
- The user logs in with a username and password.
- Salesforce detects that MFA is required and that no method is registered.
- The user picks a method, such as Salesforce Authenticator, a TOTP app (a time-based one-time password app), or a security key.
- The user proves they control the method, for example by scanning a QR code and entering a code, or by touching a key.
- Salesforce records the method and finishes the login.
Users can also manage their methods later. They open Settings, then My Personal Information, then Advanced User Details, and use the connected-method options there. Admins can use the same page for a user to remove a method.
Checking who has registered
Registered methods are stored in the TwoFactorInfo object. This query lists active users who have no registered method, so you know who still needs to act.
SELECT Id, Name, Username
FROM User
WHERE IsActive = true
AND Id NOT IN (SELECT UserId FROM TwoFactorInfo)Run it in the Developer Console query editor or in Workbench. Re-run it each week during a rollout and send reminders to the users it returns.
Common errors
| Symptom | Likely cause | Fix |
|---|---|---|
| The six-digit code is always rejected | The phone clock is out of sync, and TOTP depends on time | Turn on automatic date and time on the phone |
| The QR code will not scan | The camera app is not the authenticator app | Open the authenticator app and scan from inside it |
| The user is not asked to register | The MFA permission is not assigned, or an SSO provider handles MFA | Check the permission set and the login method |
| Registered method missing from the query | The user removed it, or an admin reset it | Ask the user to register again |
What to tell users
Send a short message before you require MFA. State the date, name the supported methods, and link to the registration steps. Tell users to install the authenticator app before they sit down to log in. Most failed first attempts happen because the app is not installed yet.
Exercise
A user says their authenticator app shows a code, but Salesforce rejects it every time. The user registered successfully last week. What is the most likely cause, and what should the user do first?
Show answer
The most likely cause is that the phone's clock has drifted, because TOTP codes are calculated from the current time. The user should turn on automatic date and time on the phone, then try the next code. If it still fails, an admin can remove the registered method so the user can register again.
Exercise
Write the condition in the registration-check query that limits results to people who can still log in.
Show answer
WHERE IsActive = true. It excludes deactivated users, so the list only contains people who need to register.