Module 10 · WebAuthn & Passkeys for APIs

Manish Garg
Manish Garg Associate of (ISC)² · RingSafe
Apr 27, 2026
2 min read
Read as

Last updated: April 29, 2026

100% Free

No signup. No paywall. No catch. One of our 10 most-requested practitioner modules — published in full so anyone can learn for free. We earn through consulting, not by gating knowledge.

See all 10 free modules →

Why this module. Phishing-resistant auth is the only auth that holds up against modern proxy-phishing attacks (EvilGinx and similar). WebAuthn / Passkeys are the standard. Apple, Google, Microsoft all default-support; Indian banks are following.

Why this module. Phishing-resistant auth is the only auth that holds up against modern proxy-phishing attacks (EvilGinx and similar). WebAuthn / Passkeys are the standard. Apple, Google, Microsoft all default-support; Indian banks are following.

Why TOTP isn’t enough anymore

EvilGinx-style proxy phishing intercepts the TOTP at login time. User enters TOTP on phishing page → attacker forwards to real site → real site issues session → attacker captures session. TOTP doesn’t help.

WebAuthn / Passkeys: cryptographic challenge tied to the legitimate origin. The phishing site can’t replay because the challenge is bound to the URL.

How WebAuthn works (briefly)

  1. Server sends a challenge.
  2. Client (browser + authenticator — laptop’s TPM, phone’s secure enclave, or hardware key) signs the challenge with a private key bound to the origin.
  3. Server verifies signature.
  4. Origin binding means signing only works for the legitimate site.

Passkeys vs WebAuthn

Passkeys are WebAuthn credentials that sync via cloud (iCloud Keychain, Google Password Manager). Reduces lock-in; one device loss doesn’t lock account.

Implementation pattern

// Client (browser)
const credential = await navigator.credentials.create({
  publicKey: {
    challenge: serverChallenge,
    rp: { name: "ringsafe.in" },
    user: { id: userId, name: email, displayName: name },
    pubKeyCredParams: [{type:"public-key", alg:-7}, {type:"public-key", alg:-257}]
  }
});

// Send credential.id + attestation to server
// Server verifies + stores public key

Integration with APIs

WebAuthn → user has a session. Session token (cookie or JWT) is what hits the API. Same as password-based auth; the strengthening is at login, not per-API-call.

For API-to-API: mTLS (Module 8) is the equivalent.

Migration from password+OTP

  1. Add Passkey as enrolment option alongside password.
  2. Promote heavily to security-conscious users.
  3. Allow Passkey OR password for 6-12 months.
  4. For high-risk operations (transfers, admin), require Passkey.
  5. Eventually deprecate password for users who have Passkeys.

Indian context

RBI has signaled Passkey-friendly stance for 2026. NPCI piloting WebAuthn in UPI. Most Indian banks still password+OTP; expect transition by 2027.

Defender’s checklist

  • WebAuthn library — SimpleWebAuthn (Node), py_webauthn (Python), java-webauthn-server.
  • Passkey enrolment in user settings.
  • Promote enrolment with security-aware UX.
  • Require Passkey for admin / high-stakes operations.
  • Plan deprecation of password for Passkey-enrolled users.
🧠
Check your understanding

Module Quiz · 6 questions

Pass with 80%+ to mark this module complete. Unlimited retries. Each question shows an explanation.

Want this for your team?

Custom team training + practitioner advisory

Beyond the free academy — we run private workshops, vCISO advisory, and red-team exercises tailored to your stack. For Indian SMBs scaling past their first hire.

Book team training call Replies in 4 working hrs · India-only · Senior consultants