Two-Factor Authentication
Implement 2FA TOTP in your Payload admin panel
Two-Factor Authentication
The plugin provides built-in support for Time-based One-Time Password (TOTP) two-factor authentication in your Payload CMS admin panel.
Disabling 2FA
2FA plugin is enabled by default to provide this feature to your Payload CMS admin panel. If you want to disable it you can change in your plugin configuration:
Admin Panel Integration
The plugin automatically adds two new admin views:
/admin/two-factor-setup
- For setting up 2FA/admin/two-factor-verify
- For verifying 2FA codes
Custom Components
The plugin provides these components for the admin panel:
SetupTwoFactorServer
VerifyTwoFactorServer
API Endpoints
The plugin exposes the following 2FA-related endpoints:
Security Considerations
- 2FA is only available for admin users
- Each user can only have one 2FA device registered
- Backup codes are automatically generated during setup
- The secret is encrypted before storage