two-factor-authentication-best-practices

Implement TOTP, OTP, backup codes, and trusted devices for 2FA sign-ins.

9|2|Updated Nov 10, 2025
One-click install
npx skills add https://github.com/FindMalek/dukkani --skill two-factor-authentication-best-practices-findmalek
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: two-factor-authentication-best-practices
Source: https://github.com/FindMalek/dukkani/tree/main/.cursor/skills/two-factor-authentication-best-practices
Command: npx skills add https://github.com/FindMalek/dukkani --skill two-factor-authentication-best-practices-findmalek

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Modern apps face significant risk from weak authentication. This Skill provides a structured approach to implementing robust multi-factor authentication using TOTP, OTP delivery, backup codes, and trusted devices to strengthen login security.

Core Features & Use Cases

  • Implement TOTP authenticator setup with QR codes and user verification.
  • Deliver one-time passwords via email or SMS for non-TOTP flows and backup verification.
  • Manage backup codes and trusted devices, including recovery and revalidation during sign-in.
  • Integrate end-to-end 2FA sign-in flows into web and mobile apps with server and client glue.
  • Use cases include securing admin dashboards, protecting user accounts, and MFA onboarding.

Quick Start

Configure your server with the twoFactor plugin (issuer) and enable the client-side twoFactorClient to secure user sign-ins.

Frequently Asked Questions about two-factor-authentication-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement TOTP and OTP delivery for multi-factor authentication?

Implement TOTP and OTP delivery for multi-factor authentication by configuring a server plugin with an issuer and a client-side plugin. This enables QR code setup, user verification, and one-time password delivery via email or SMS to secure sign-ins.

What is the best way to manage backup codes and trusted devices in a 2FA flow?

The best way to manage backup codes and trusted devices in a 2FA flow is to use a structured MFA pattern that handles recovery and revalidation during sign-in. This ensures users can regain access securely if their primary device is lost.

How do I set up an end-to-end 2FA sign-in flow for web and mobile apps?

Set up an end-to-end 2FA sign-in flow for web and mobile apps by adding a twoFactor server plugin with an issuer and a client-side twoFactorClient. Apply necessary migrations to enable and verify MFA across your application.

Do I need server and client plugins to enable MFA onboarding for admin dashboards?

Yes, enabling MFA onboarding for admin dashboards requires adding a twoFactor server plugin with an issuer and a client plugin. You also need to apply the necessary migrations to verify and secure user sign-ins.

Can I use email or SMS one-time passwords instead of TOTP for two-factor authentication?

Yes, you can use email or SMS one-time passwords instead of TOTP for two-factor authentication. This approach delivers one-time passwords for non-TOTP flows and provides a backup verification method to secure user accounts.