two-factor-authentication-best-practices

Implement and enforce TOTP, OTP, and backup code 2FA with a plugin.

Updated Feb 23, 2026
One-click install
npx skills add https://github.com/masakinihirota/vns-masakinihirota-better-old --skill two-factor-authentication-best-practices-masakinihirota
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: two-factor-authentication-best-practices
Source: https://github.com/masakinihirota/vns-masakinihirota-better-old/tree/main/.agent/skills/two-factor-authentication-best-practices
Command: npx skills add https://github.com/masakinihirota/vns-masakinihirota-better-old --skill two-factor-authentication-best-practices-masakinihirota

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides comprehensive guidance and enforcement rules for implementing secure two-factor authentication (2FA) within applications, ensuring enhanced user account security.

Core Features & Use Cases

  • Multi-Method Support: Supports Time-based One-Time Passwords (TOTP) via authenticator apps, One-Time Passwords (OTP) via email/SMS, and backup codes for recovery.
  • Secure Implementation: Offers configuration options for code validity, storage encryption, rate limiting, and trusted device management.
  • Use Case: A SaaS platform needs to add a mandatory 2FA layer for all user logins to comply with security standards and protect sensitive customer data. This Skill guides the developers through setting up TOTP and OTP verification flows.

Quick Start

Configure the twoFactor plugin with your app name as the issuer for TOTP.

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 two-factor authentication with TOTP in my web app?

Implement two-factor authentication by configuring a dedicated 2FA plugin with your app name as the TOTP issuer. This guides secure setup of authenticator app flows, code generation, and verification to protect user accounts.

What is the best way to generate and manage backup codes for 2FA?

The best way to manage backup codes is using a dedicated 2FA plugin that handles secure generation, storage encryption, and verification of recovery codes. This ensures users can regain access safely if they lose their primary 2FA device.

Does this 2FA implementation support OTP delivery via email or SMS?

Yes, this 2FA implementation supports One-Time Passwords (OTP) via email or SMS alongside TOTP. It provides configuration options for code validity periods and rate limiting to secure the OTP delivery and verification process.

How do I handle session security and rate limiting for authentication endpoints?

Handle session security and rate limiting by applying the enforcement rules provided for 2FA mechanisms. This includes configuring storage encryption, trusted device management, and rate limits on verification attempts to prevent brute force attacks.

When should I disable 2FA for credential-based accounts?

Disable 2FA for credential-based accounts when users need to recover access due to lost devices or when transitioning authentication methods. The Skill provides specific guidance on safely disabling two-factor authentication without compromising overall account security.

Can I enforce mandatory two-factor authentication for all users on a SaaS platform?

Yes, you can enforce mandatory two-factor authentication for all users on a SaaS platform. The Skill provides configuration options for trusted devices and multi-method support to help comply with security standards and protect sensitive customer data.