Prompt
How do I set up MFA for enterprise users in a SaaS product?
Latest observation
Setting up MFA for enterprise users in a SaaS product usually means supporting both identity-provider-driven MFA and, sometimes, app-enforced MFA. The best approach depends on how your customers authenticate users.
1) Prefer federated enterprise login
Most enterprise customers want to use their own identity provider (IdP), such as:
- Azure AD / Microsoft Entra ID
- Okta
- Ping
- Google Workspace
- OneLogin
In this model, your app should support:
- SAML 2.0 or OIDC/OAuth 2.0
- SSO
- Just-in-time (JIT) provisioning or SCIM for user provisioning
Why this is best
The enterprise’s IdP handles:
- MFA policy enforcement
- device trust
- conditional access
- recovery flows
- admin controls
Your app only needs to trust the assertion/token from the IdP.
2) Decide where MFA is enforced
You generally have 3 options:
A. IdP-enforced MFA only
Best for enterprise SaaS.
Your app:
- redirects to IdP
- receives SAML/OIDC response
- grants access if the login is valid
Your app may also inspect claims like:
amr(authentication methods reference)acr(authentication context class reference)
This helps you know whether MFA was used, if the IdP provides it.
B. App-enforced MFA
Used when users authenticate directly with your app username/password.
Support factors like:
- TOTP authenticator apps
- WebAuthn/FIDO2 security keys
- passkeys
- backup codes
- SMS/Email only as fallback, if at all
C. Hybrid
Common in SaaS:
- enterprise SSO users rely on IdP MFA
- local users must enroll MFA in your app
3) Support enterprise requirements
Enterprise admins often want:
- mandatory MFA for all users
- MFA only for privileged roles
- step-up authentication for sensitive actions
- enforcement by group, domain, or policy
- ability to require specific factor types
- audit logs for MFA events
4) Recommended MFA methods
Best to worst for enterprise security:
- WebAuthn / Passkeys / FIDO2 security keys
- Authenticator app (TOTP)
- Push-based MFA via IdP or your own service
- SMS / Email OTP as fallback only
For enterprise SaaS, aim to support:
- WebAuthn/passkeys
- TOTP
- backup recovery codes
Avoid relying on SMS as the primary method.
5) Enrollment flow for app-managed MFA
If you manage MFA yourself, typical flow:
- User signs in with password
- Prompt to enroll MFA
- User scans QR code for TOTP or registers a security key
- Verify the second factor
- Mark MFA as enrolled
- Require MFA on future logins
Also provide:
- backup codes
- device management
- recovery/reset by admin
- ability to add multiple factors
6) Admin and policy controls
Build an admin settings page for:
- required MFA policy
- allowed factor types
- grace period before enforcement
- recovery/reset workflows
- session duration
- step-up rules for sensitive actions
- audit history
7) Session handling
After MFA is satisfied:
- issue a session with a clear “MFA completed” state
- use shorter session lifetimes for sensitive apps
- re-prompt for MFA on:
- password change
- exporting data
- changing billing/admin settings
- accessing secrets or PII
8) Log and audit everything
Track:
- MFA enrollment
- MFA challenge success/failure
- factor added/removed
- admin reset
- recovery code use
- login method
- IdP claims indicating MFA status
This is important for enterprise compliance and support.
9) Implementation checklist
Minimum recommended support:
- SSO via SAML and/or OIDC
- SCIM provisioning
- MFA claim validation from IdP
- TOTP for non-federated users
- WebAuthn/passkeys
- backup/recovery codes
- admin policy controls
- audit logs
- step-up auth for sensitive actions
10) Practical recommendation
If you’re designing this from scratch:
- Use SSO as primary auth for enterprise customers
- Let the IdP handle MFA whenever possible
- Support app-level MFA only for local accounts or fallback
- Support WebAuthn + TOTP
- Provide strong admin controls and auditing
If you want, I can also give you:
- a product requirements spec for enterprise MFA,
- an architecture diagram, or
- implementation examples for SAML/OIDC + MFA claims.