Skip to content
risingisland edited this page Apr 4, 2026 · 2 revisions

Welcome to the 2FA for GS wiki!

πŸ” 2FA for GS

Add Two-Factor Authentication (2FA) to your GetSimple CMS admin login using any TOTP-compatible app such as Google Authenticator, Authy, or 1Password.

screenshot

✨ Features

  • πŸ”’ Secure admin login with TOTP (RFC 6238)
  • πŸ“± Works with Google Authenticator, Authy, 1Password, and more
  • πŸ”‘ Single-use recovery codes
  • 🧠 SQLite-based storage (no external dependencies)
  • ⚑ Lightweight and self-contained
  • πŸͺ Session-based verification (configurable duration)
  • 🎯 Seamless integration with GetSimple CMS

πŸ“¦ Requirements

  • GetSimple CMS
  • PHP with:
    • SQLite3 enabled
    • Standard extensions (hash, openssl)

πŸš€ Installation

  1. Upload the plugin file:

    2FAforGS.php

    to:

    /plugins/
  2. Log into your admin panel

  3. Activate the plugin:

    Plugins β†’ 2FA for GS
    

βš™οΈ Setup Guide

  1. Go to:

    Settings β†’ 2FA for GS
    
  2. Click Enroll Now

  3. Scan the QR code with your authenticator app
    OR enter the secret manually

  4. Enter the 6-digit code to confirm


πŸ“± Supported Apps

  • Google Authenticator
  • Authy
  • 1Password
  • Any TOTP-compatible app

πŸ”‘ Login Flow

  1. Enter your username and password
  2. If 2FA is enabled, you’ll be prompted for a code
  3. Enter either:
    • Authenticator code
    • OR Recovery code

🧯 Recovery Codes

  • 8 recovery codes are generated during setup
  • Each code can only be used once

⚠️ Recovery codes are only shown once β€” store them securely.

πŸ”„ Regenerating Codes

Settings β†’ 2FA for GS β†’ Regenerate Codes
  • Old codes will stop working after regeneration

πŸ”„ Resetting 2FA

Settings β†’ 2FA for GS β†’ Reset 2FA

This will:

  • Remove your secret
  • Disable 2FA
  • Require re-enrollment

βš™οΈ Configuration

πŸͺ Cookie Duration

Default (3 hours):

setcookie(GS2FA_COOKIE, '1', time() + 10800, '/', '', false, true);

⏱ Common Values

Duration Value
Session only 0
1 hour 3600
3 hours 10800

πŸ—„οΈ Database

Location:

/data/other/gs_2fa.db

πŸ›‘οΈ Security Notes

  • Secrets stored in SQLite database
  • Recovery codes hashed using password_hash()
  • TOTP uses RFC 6238
  • Time drift tolerance: Β±1 window
  • Uses HTTP-only cookies

🐞 Troubleshooting

SQLite Error

Make sure SQLite3 is enabled:

extension=sqlite3

Locked Out

  • Use a recovery code
  • Or delete:
/data/other/gs_2fa.db

❀️ Support / Donate

https://getsimple-ce.ovh/donate