Credential management is part of the authentication system. A user may enroll several passkeys, lose a device, replace a synced account, or suspect that an authenticator is no longer under their control. The product needs a way to inspect labeled credentials, add a new one, remove an old one, and recover access without letting recovery bypass all safeguards. Sensitive operations such as adding a credential, changing recovery channels, or exporting private data may require fresh proof of account control. That step-up decision should be server-owned, short-lived, and tied to the exact operation rather than a client-side flag.
Passkey Management, Recovery, and Step-Up
Working case
Reviewer 29 loses a tablet that holds one of two passkeys. From a trusted session on a laptop, the reviewer opens credential settings, performs the product’s required fresh verification, removes the lost credential, and sees its last-used metadata. The server invalidates the credential for future assertions while leaving the second passkey usable. If both credentials are lost, the reviewer enters a distinct recovery workflow with delay or human review according to product risk. A recovery success should rotate active sessions where policy requires and should not automatically restore access to cases from an old tenant assignment.
Implementation boundary
function mayChangeCredentials(session, now) {
return session.assurance === "recent-verified" && now < session.assuranceExpiresAt;
}
console.log(mayChangeCredentials({ assurance: "signed-in", assuranceExpiresAt: 80 }, 47));
// Output: falseStore credential IDs, public keys, creation time, last-used time, user-facing labels, and optional authenticator metadata under the account; do not store a private key. Require current authorization and recent verified assurance for add, remove, and recovery-channel changes. Define what happens when the user tries to remove the last usable credential. A recovery method needs its own abuse limits, audit record, and notification to existing channels, while avoiding account enumeration. After credential removal, reject future assertions for that ID even if a challenge was issued earlier. Reevaluate tenant and object permissions after recovery because authentication and authorization change independently.
Cost and boundaries
Credential lookup and removal are O(1) with an indexed identifier; each additional enrolled credential adds a small record and settings item. Step-up prompts add friction and may interrupt work, so restrict them to operations whose risk justifies it and record how long a proof remains valid. Recovery support is operationally expensive but prevents lockout. Too many recovery shortcuts can become the easiest attack path. Measure lost-device removal time, recovery completion and abuse, stale credential rejection, and whether users retain at least one working method after routine account changes.
Failure trace
A reviewer removes a passkey in settings, but the credential remains accepted because a cache still marks it active. A later assertion signs in from the lost device. Invalidate the credential at the authoritative lookup and test immediately. Another flow lets a signed-in but unattended browser add a new passkey without fresh assurance. Require step-up. Finally, a recovery path that sends a link to an unverified new address lets an attacker take over the account. Treat recovery destination changes as sensitive operations with separate confirmation and logging.
Verification
- Removed credential IDs fail subsequent assertions.
- Sensitive credential changes require recent server-verified assurance.
- Recovery does not revive stale tenant or object access.
Practice drill
Enroll two credentials for reviewer 29. Remove one after step-up and attempt sign-in with it; it must fail while the other succeeds. Try removing the last credential and follow the documented recovery decision. Begin a sign-in before removal but finish it afterward, then inspect the server’s current credential check. Simulate loss of every credential and execute the recovery workflow under rate limits. After recovery, verify old sessions and case permissions follow current policy.
Decision note
Keep credentials manageable and recovery usable, while making account changes depend on fresh server-verified assurance.
Common Mistakes
- Treating a logged-in tab as sufficient proof for every credential change.
- Leaving removed credentials active in a cache.
- Making recovery easier to abuse than primary sign-in.
Connected lessons
Passkeys and Account Assurance; Passkey Registration Challenge and Credential Binding; Passkey Assertion, Origin, and Signature Verification; Passkey Conditional Sign-In and Fallback; Account Recovery and Session Revocation; Permission Revocation and Active Sessions; Object-Level Authorization for Reads and Writes.
Apply and check
Build Project: passkey account lifecycle and review Web Development: passkey and checkout decisions quiz.
