Passkeys = sfârșitul parolelor
Passkey = pereche public/private key generată pe device-ul user-ului, signed cu biometric/PIN. La login, browser cere user să confirme cu Touch ID / Face ID / Windows Hello / YubiKey, sign-uiește challenge primit de la server. Server verifică signature cu public key stocat. Avantaje vs parole: imposibil phishing (passkey legată de domain), imposibil de furat (private key nu părăsește device-ul), no rotation needed, instant login.
Hand-rolled implementation
Megaforms implementează WebAuthn fără library-uri (zero deps). Code base: ~300 linii TypeScript pentru registration + authentication flows. CBOR decode/encode hand-written pentru attestation parsing. Web Crypto pentru signature verify. Suportăm algoritmi: ES256 (default, Touch ID/Face ID), RS256 (Windows Hello older), EdDSA (YubiKey 5+).
// Verify signature (simplified)
async function verifyAssertion(
publicKey: CryptoKey,
authData: ArrayBuffer,
clientDataHash: ArrayBuffer,
signature: ArrayBuffer
): Promise<boolean> {
const signedData = concat(authData, clientDataHash);
return await crypto.subtle.verify(
{ name: 'ECDSA', hash: 'SHA-256' },
publicKey,
signature,
signedData
);
}Multi-device passkeys (iCloud Keychain, Google Password Manager)
Pe iOS 17+ / macOS Sonoma, passkey-urile se sincronizează automat prin iCloud Keychain — creezi pe iPhone, login pe MacBook fără re-enrollment. Similar pe Android cu Google Password Manager. Pe Windows, currently passkey-urile sunt device-bound (nu sync), dar Microsoft a anunțat sync prin Edge profiles în roadmap.
Fallback strategy
Passkeys e PRIMARY auth în Megaforms (după setup), dar păstrăm fallbacks: TOTP (vezi /features/2fa-totp), email magic link, parolă tradițională cu 2FA. User alege ce metode activează. Recomandare security: passkey + TOTP backup pentru cazul device lost.
Browser support 2026
WebAuthn Level 3 suportat: Chrome 108+, Edge 108+, Firefox 119+, Safari 16+. Coverage real ~96% utilizatori 2026. Pentru < 4% pe browsere vechi, fallback automat la TOTP. Detection feature `PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable()`.