Skip to content
The InfiQ GlossaryFeature

Security & identity

Two-Factor Authentication(2FA)

A login that needs a second proof besides the password — an authenticator code, security key or passkey — so a stolen password is not enough.

Also called: Multi-factor authentication · MFA · 2-step login

InfiQ Glossaryreviewed Foundation

What is two-factor authentication (2FA)?

Two-factor authentication (2FA) is a login method that asks for two different kinds of proof: something you know, such as a password, plus something you have, such as a phone running an authenticator app or a hardware security key — or something you are, such as the fingerprint that unlocks a passkey. It is the most common form of multi-factor authentication (MFA), and its point is simple: a password that has been phished, leaked or reused elsewhere is no longer enough on its own.

Second factors are not equal. SMS and voice codes can be redirected through SIM swap fraud or simply typed into a phishing page. Time-based codes from an authenticator app (TOTP: six digits that change every 30 seconds) avoid the phone network but can still be relayed by a real-time phishing site. Push approvals are convenient but invite "MFA fatigue" prompt-spamming. Passkeys and security keys, built on the FIDO2 and WebAuthn standards, are phishing-resistant: the device signs a challenge only for the genuine website, so a look-alike domain gets nothing usable.

In WhatsApp Business operations, 2FA belongs on every login that can control the account: the Facebook and Meta accounts of people in your Meta business portfolio, whose settings let full-control admins require 2FA for admins only or for everyone; your WhatsApp provider's dashboard; and your own systems that hold access tokens. It is easily confused with WhatsApp's two-step verification — the six-digit PIN on a business phone number that is needed to register it on the Cloud API. That PIN locks the number; 2FA protects the people who manage it. Some older guides call the PIN "2FA"; it is covered separately under PIN verification.

Key takeaways

  • Two-factor authentication requires a second factor at login, so a stolen or guessed password alone cannot take over an account.
  • Factors differ in strength: security keys and passkeys resist phishing, authenticator apps are good, SMS codes are the weakest.
  • A Meta business portfolio can require 2FA for admins only or for everyone who works in it.
  • 2FA protects people's logins; the six-digit two-step verification PIN protects the WhatsApp business phone number itself.
  • When staff use single sign-on, enforce 2FA at the identity provider and keep recovery codes for every admin.

Figure 1

Climb the 2FA ladder: which factor stops phishing?

5 / 5
  1. Tier 1: Password only (below the current tier)No second factor
  2. Tier 2: SMS or voice code (below the current tier)Tied to a SIM
  3. Tier 3: Authenticator app (TOTP) (below the current tier)6 digits every 30 seconds
  4. Tier 4: Push with number matching (below the current tier)Approve on a known device
  5. Tier 5: Passkey (below the current tier)FIDO2 / WebAuthn, synced
  6. Tier 6: Hardware security key (current)FIDO2, device-bound
Move 5 of 5Climbs a tier

Tier 6 · Hardware security key

FIDO2, device-bound

Why: Portfolio admins add hardware keys, with a spare key locked away.

Phishing-resistant, and the private key never leaves the key. Best for portfolio admins and anyone who can see API tokens.

Second factors ranked by how well they resist phishing and SIM swaps. Follow a support team as it climbs from passwords to security keys, and see what each step stops.

Move 5 of 5: climbs to tier 6, Hardware security key (FIDO2, device-bound). Portfolio admins add hardware keys, with a spare key locked away.

Why it matters

Why does two-factor authentication (2FA) matter?

A hijacked admin login on a Meta business portfolio can add new admins, change payment methods, move assets to another business and send messages in the brand's name — and the first sign is often customers reporting scams from your verified number. Passwords leak constantly through phishing and reuse; 2FA is the cheapest control that stops most of those takeovers, and phishing-resistant factors stop nearly all of the rest.

Example: The admin who clicked a fake policy-violation email

A Lucknow coaching institute's marketing head receives an email claiming her Meta business account will be disabled for a policy violation, with a link to "appeal". She types her password into the look-alike page. Because the institute's business portfolio requires 2FA for everyone and she signs in with a passkey, the attacker's login stalls at the second step: her passkey will not sign anything for the fake domain. The security team resets her password the same afternoon, and nothing in the WhatsApp Business Account changes.

— The admin who clicked a fake policy-violation email

How does two-factor authentication (2FA) work?

  1. Choose the factors you allow

    Prefer passkeys or security keys for admins, authenticator apps for everyone else, and SMS only as a fallback where nothing else is possible.

  2. Enforce it in the Meta business portfolio

    A full-control admin opens Business portfolio info in the portfolio's settings and, next to Two-factor authentication under Business options, chooses admins only or everyone. People without 2FA must turn it on before they can open the portfolio.

  3. Enforce it on your dashboards

    Turn on mandatory 2FA in your WhatsApp provider's dashboard, or enforce it at your identity provider if staff sign in with single sign-on.

  4. Enrol two factors and save recovery codes

    Each person registers at least two factors — for example a passkey on their laptop and an authenticator app on their phone — and keeps recovery codes in a password manager.

  5. Review and recover safely

    Check monthly that every admin still has 2FA on. When someone loses a factor, verify them through a second channel before resetting it: attackers use "I lost my phone" too.

Common mistakes with two-factor authentication (2FA)

  • Relying on SMS codes for admins

    SMS can be redirected by SIM swap fraud and typed into phishing pages. Give admins passkeys or security keys and keep SMS as a last-resort fallback.

  • Enforcing 2FA in one place only

    Protecting the provider dashboard while Meta business portfolio admins log in with passwords alone leaves the bigger door open. Require 2FA in the portfolio, the dashboard and every system that holds tokens.

  • No recovery plan

    An admin who loses their only factor can lock a business out of its own portfolio. Register two factors per person, store recovery codes and keep more than one full-control admin.

  • Confusing 2FA with the number's PIN

    Turning on account 2FA does not set the WhatsApp number's two-step verification PIN, and the PIN does not protect logins. Manage both, and keep the PIN in your secret store.

  • Shared logins with one phone for codes

    A shared agent login whose codes go to a supervisor's phone destroys accountability and breaks when that person leaves. Give everyone their own account and their own factor.

Two-factor authentication (2FA) in code

import crypto from "node:crypto";
// RFC 6238 TOTP: 6 digits, 30-second steps, HMAC-SHA1 (the authenticator-app default)
function totp(secret, timeMs, step = 30, digits = 6) {
const counter = Buffer.alloc(8);
counter.writeBigUInt64BE(BigInt(Math.floor(timeMs / 1000 / step)));
const h = crypto.createHmac("sha1", secret).update(counter).digest();
const offset = h[h.length - 1] & 0x0f;
const code = (h.readUInt32BE(offset) & 0x7fffffff) % 10 ** digits;
return code.toString().padStart(digits, "0");
}
// Accept the current step and one either side for clock drift; compare in constant time.
export function verifyTotp(secret, submitted, now = Date.now()) {
const given = Buffer.from(String(submitted));
return [-1, 0, 1].some((w) => {
const expected = Buffer.from(totp(secret, now + w * 30_000));
return expected.length === given.length && crypto.timingSafeEqual(expected, given);
});
}
// Also remember the last accepted step per user so the same code cannot be replayed,
// and rate-limit attempts: six digits is only a million possibilities.

For your own dashboard: `secret` is the per-user key shared via the enrolment QR code, stored encrypted on the server.

Best practices for two-factor authentication (2FA)

  • Keep at least two full-control admins on the Meta business portfolio, each with a security key.
  • Prefer passkeys or number-matching push over plain approve-or-deny prompts.
  • Treat a sudden burst of 2FA prompts as an attack in progress and reset the password at once.
  • Remind customers to turn on WhatsApp two-step verification — it protects them from SIM-swap takeovers.

2FA FAQs

Is two-factor authentication the same as WhatsApp's two-step verification PIN?
No. Two-factor authentication protects a person's login, such as a Meta account or a dashboard; two-step verification is a six-digit PIN on a phone number that is needed to register that number. A business needs both.
How do I require two-factor authentication in my Meta business portfolio?
A full-control admin sets it in the business portfolio's settings, under the two-factor authentication option, choosing admins only or everyone. Each person then turns on 2FA for their own Facebook or Meta account.
Which 2FA method is the most secure?
Security keys and passkeys are the most secure because they resist phishing. Authenticator apps come next, and SMS codes are the weakest because of SIM swaps and phishing pages.
Can two-factor authentication be bypassed?
Some methods can. Real-time phishing kits relay SMS and authenticator codes, and push prompts can be spammed until someone approves. FIDO2 passkeys and security keys resist these attacks because they only respond to the genuine website.

Reach customers on WhatsApp

Start a 7-day free trial of the official WhatsApp Business API — no card needed.