Sub topic 6
MFA when users sign in through single sign-on
This chapter assumes you know basic Salesforce administration (users, profiles, permission sets) and have read the earlier chapters on what MFA is and how to enable it. Here you will see how MFA behaves when users do not type a Salesforce password at all.
Two ways to satisfy the MFA requirement
Single sign-on (SSO) lets users sign in to Salesforce with credentials managed by another system, called the identity provider (IdP). Salesforce is the service provider (SP). The IdP checks who the user is and sends Salesforce a signed assertion, usually over SAML or OpenID Connect.
Salesforce requires MFA for direct logins to the org. With SSO you have two choices:
- MFA at the identity provider. The IdP asks for a second factor, and Salesforce accepts the result. Salesforce does not prompt again.
- MFA in Salesforce. Salesforce asks for its own second factor after the IdP login succeeds.
The first choice is the usual one. Users see one prompt, and your IdP policies apply to every app it protects.
Telling Salesforce that the IdP did MFA
Salesforce cannot see what happened at the IdP. The assertion must say so. In a SAML login, the IdP includes an authentication context (the AuthnContextClassRef value). To report MFA, it sends this value:
http://schemas.microsoft.com/claims/multipleauthnFor OpenID Connect, the IdP reports MFA in the amr claim (authentication methods references), for example mfa.
When Salesforce sees that value, it treats the login as MFA-verified. You then need to leave the Salesforce-side MFA requirement off for those users, or they may be prompted twice.
Configuring the Salesforce side
- In Setup, open Single Sign-On Settings (SAML) or your Auth. Provider (OpenID Connect) and confirm the login works.
- Decide who uses SSO. Users who sign in only through SSO need the IdP to enforce MFA.
- Make sure users who also log in directly, such as administrators with a break-glass account, are covered by Salesforce MFA.
- Test with a pilot user and check the result in login history (see the chapter on reviewing login history).
Common errors
| Symptom | Likely cause | Fix |
|---|---|---|
| Users see two MFA prompts | The IdP does MFA, and Salesforce MFA is also enabled for them | Choose one place to enforce it, or accept the double prompt on purpose |
| Salesforce asks for MFA after a good IdP login | The assertion lacks the MFA authentication context | Configure the IdP to send the context value or `amr` claim |
| Users bypass MFA through a direct login URL | Direct login stays enabled for SSO users | Apply Salesforce MFA to them, or disable password login for SSO-only users |
| Login fails after an IdP certificate renewal | Salesforce still holds the old certificate | Upload the new certificate in the SSO settings |
Choosing between the options
Pick IdP-side MFA when your company already runs a central IdP with strong policies and most users sign in through it. Pick Salesforce-side MFA when the IdP cannot send the MFA context, or when you want Salesforce to enforce its own verification regardless of the IdP.
Exercise
Users sign in to Salesforce through your company's SAML IdP, which already requires a second factor. They complain that Salesforce asks for another verification each time. What is the most likely cause, and what are two ways to fix it?
Show answer
The IdP's assertion does not tell Salesforce that MFA was done, so Salesforce adds its own prompt. Fix it by configuring the IdP to send the MFA authentication context value (http://schemas.microsoft.com/claims/multipleauthn) in the assertion, or, if the IdP cannot send it, accept Salesforce MFA as the single enforcement point for those users. Also check that Salesforce MFA is not enabled on top of IdP MFA by mistake.