MaanAuth
? 专为 Paper & Spigot 1.21.x 打造的现代、安全认证插件
从零构建,专注于安全性、性能以及精致的玩家体验。
? 安全性
- ?️ Argon2id 密码哈希 —— 当前的黄金标准。支持 BCrypt 作为已迁移账户的遗留回退方案。出于安全考虑,完全不支持 SHA1/MD5/SHA256。
- ? 双因素认证 (TOTP) —— 完全符合 RFC 6238 标准,兼容 Google Authenticator、Authy 及任何标准 TOTP 应用。无外部依赖,从零实现。
- ⚔️ 暴力破解防护 —— 渐进式登录延迟(1s > 2s > 5s > 10s > 30s > 60s),并在多次尝试失败后配置临时账户锁定。
- ? 防机器人重连节流 —— 对于以超过可配置阈值的频率重新连接的 IP,立即强制其进行验证码挑战。
- ? 验证码系统 —— 在重复登录失败或可疑的快速重连后自动触发。通过状态栏 (ActionBar) 或标题 (Title) 显示。
- ? 记住我会话 —— 成功登录后会保存一个绑定可信 IP 的会话。如果在配置的窗口期内(默认 7 天)从同一 IP 重新连接,将完全跳过
/login。执行 /logout 会立即清除该会话。
✨ 玩家体验
- ? 持久化登录标题 —— 重复显示的标题/副标题每隔几秒提醒未认证玩家,确保提示不会淹没在聊天中。在验证码期间会自动暂停。
- ? 烟花登录特效 —— 认证成功时会在旁边播放一小束烟花,并伴有可配置的声音和标题。可完全切换开关。
- ? 最后位置恢复 —— 玩家将被传送回他们上次离开时的确切位置。如果没有保存的位置,则回退到可配置的认证出生点。
- ? 玩家隔离 —— 未认证的玩家会被完全冻结并从服务器其他玩家视野中隐藏。在未认证前,他们无法移动、破坏或放置方块、打开物品栏、聊天、使用白名单外的命令、造成或受到伤害、拾取物品或与任何东西交互。
- ⭐ 正版自动登录 —— 通过 Mojang API(缓存、异步)检测属于 Mojang 账户的用户名,可以完全跳过
/register 和 /login。可完全切换开关。
- ? 彩色格式化消息 —— 每条消息均使用粗体强调、颜色编码的状态符号以及带边框的聊天横幅。可通过
messages.yml 完全自定义。
? 命令
/register <pass> <confirm> —— 创建你的账户
/login <pass> —— 登录你的账户
/logout —— 登出并清除你的可信会话
/changepassword <old> <new> <confirm> —— 修改密码
/unregister <pass> —— 永久删除你的账户
/captcha <code> —— 提交验证码代码
/premium —— 检查你的用户名是否拥有 Mojang 账户
/2fa enable —— 启用 2FA 并获取你的密钥
/2fa verify <code> —— 确认 2FA 设置或完成登录挑战
/2fa disable —— 禁用你账户上的 2FA
/maanauth reload —— 实时重载配置和消息
/maanauth status —— 查看在线人数、已认证人数、数据库类型
/maanauth info <player> —— 查看任意玩家的账户详情
/maanauth history <player> —— 查看最近 10 次登录事件,包含 IP 和时间戳
/maanauth unlock <player> —— 解锁被锁定的账户
/maanauth setauthlocation —— 将当前所在位置设置为认证出生点
/maanauth clearauthlocation —— 将认证出生点重置为默认值
?️ 数据库
- ? 开箱即用的 SQLite —— 零设置,立即生效。
- ? 支持 MySQL 和 MariaDB —— 只需在
config.yml 中填写连接详情。
- ⚡ HikariCP 连接池 —— 所有数据库 I/O 均在专用的异步线程池上运行。绝不会阻塞服务器主线程。
- ? 自动模式创建与迁移 —— 首次运行时创建表。从旧版本升级时,会安全地添加新列而不触碰现有数据。
- ? 审计日志 —— 每次注册、登录、失败尝试、密码更改、2FA 事件和登出都会记录 IP 和时间戳。
⚙️ 配置
无需接触代码即可配置所有内容。
- ? 密码强度规则(最小/最大长度、大写字母、数字、特殊字符)
- ⏱️ 登录超时和冻结行为
- ? 暴力破解延迟和锁定持续时间
- ? 验证码触发阈值、代码长度和显示模式
- ⭐ 正版检测和自动登录开关
- ? 会话(记住我)持续时间
- ? 认证出生点位置(或在游戏内使用
/maanauth setauthlocation 设置)
- ? 登录声音、标题文本和烟花开关
- ? 未认证玩家允许使用的命令白名单
- ?
messages.yml 中的所有玩家可见消息
? 权限
maanauth.use —— 基本认证命令(默认:所有人)
maanauth.admin —— 所有 /maanauth 管理子命令(默认:op)
maanauth.bypass —— 完全跳过认证
maanauth.captcha.bypass —— 跳过验证码挑战
? 需求
- ✅ Paper 或 Spigot 1.21.x
- ✅ Java 21
- ✅ 无外部插件依赖 —— 所有库均已阴影打包进 jar 文件
由 maan.exe 构建 ?
MaanAuth
? The modern, secure authentication plugin for Paper & Spigot 1.21.x
Built from scratch with a focus on security, performance, and a polished player experience.
? Security
- ?️ Argon2id password hashing — the current gold standard. BCrypt supported as a legacy fallback for migrated accounts. SHA1/MD5/SHA256 are intentionally not supported anywhere.
- ? Two-Factor Authentication (TOTP) — fully RFC 6238 compliant, works with Google Authenticator, Authy, and any standard TOTP app. No external dependency, implemented from scratch.
- ⚔️ Brute-force protection — progressive login delays (1s > 2s > 5s > 10s > 30s > 60s) with configurable temporary account lockout after too many failed attempts.
- ? Anti-bot rejoin throttle — IPs that reconnect faster than a configurable threshold are immediately forced into a CAPTCHA challenge.
- ? CAPTCHA system — triggered automatically after repeated failed logins or suspicious rapid reconnects. Displayed via ActionBar or Title.
- ? Remember-me sessions — successful logins save a trusted IP-bound session. Reconnecting from the same IP within the configured window (default 7 days) skips /login entirely. /logout clears it immediately.
✨ Player Experience
- ? Persistent login title — a repeating title/subtitle reminds unauthenticated players every few seconds so the prompt never gets lost in chat. Pauses automatically during CAPTCHA.
- ? Firework login effect — a small burst firework pops on successful authentication alongside a configurable sound and title. Fully toggleable.
- ? Last location restore — players are teleported back to exactly where they were when they last left. Falls back to a configurable auth spawn if no location is saved.
- ? Player isolation — unauthenticated players are completely frozen and hidden from the rest of the server. They cannot move, break or place blocks, open inventories, chat, use commands outside the whitelist, deal or receive damage, pick up items, or interact with anything until authenticated.
- ⭐ Premium auto-login — names that belong to Mojang accounts are detected via the Mojang API (cached, async) and can skip /register and /login entirely. Fully toggleable.
- ? Colored formatted messages — every message uses bold accents, color-coded status symbols, and framed chat banners. Fully customisable via messages.yml.
? Commands
/register <pass> <confirm> — Create your account
/login <pass> — Log into your account
/logout — Log out and clear your trusted session
/changepassword <old> <new> <confirm> — Change your password
/unregister <pass> — Permanently delete your account
/captcha <code> — Submit a CAPTCHA code
/premium — Check if your username has a Mojang account
/2fa enable — Enable 2FA and get your secret key
/2fa verify <code> — Confirm 2FA setup or complete a login challenge
/2fa disable — Disable 2FA on your account
/maanauth reload — Reload config and messages live
/maanauth status — See online count, authenticated count, DB type
/maanauth info <player> — View account details for any player
/maanauth history <player> — View last 10 login events with IPs and timestamps
/maanauth unlock <player> — Clear a locked account
/maanauth setauthlocation — Set the auth spawn to your current position
/maanauth clearauthlocation — Reset the auth spawn to defaults
?️ Database
- ? SQLite out of the box — zero setup, works immediately.
- ? MySQL and MariaDB supported — just fill in the connection details in config.yml.
- ⚡ HikariCP connection pooling — all database I/O runs on a dedicated async thread pool. Nothing ever blocks the server main thread.
- ? Automatic schema creation and migration — tables are created on first run. Upgrading from an older install safely adds new columns without touching existing data.
- ? Audit log — every register, login, failed attempt, password change, 2FA event, and logout is recorded with IP and timestamp.
⚙️ Configuration
Everything is configurable without touching code.
- ? Password strength rules (min/max length, uppercase, numbers, special chars)
- ⏱️ Login timeout and freeze behaviour
- ? Brute-force delays and lockout duration
- ? CAPTCHA trigger threshold, code length, and display mode
- ⭐ Premium detection and auto-login toggle
- ? Session (remember-me) duration
- ? Auth spawn location (or set it in-game with /maanauth setauthlocation)
- ? Login sound, title text, and firework toggle
- ? Per-command allowed list for unauthenticated players
- ? All player-facing messages in messages.yml
? Permissions
maanauth.use — Basic auth commands (default: everyone)
maanauth.admin — All /maanauth admin subcommands (default: op)
maanauth.bypass — Skip authentication entirely
maanauth.captcha.bypass — Skip CAPTCHA challenges
? Requirements
- ✅ Paper or Spigot 1.21.x
- ✅ Java 21
- ✅ No external plugin dependencies — all libraries are shaded into the jar
Built by maan.exe ?
评论 0
登录后参与评分
还没有评论,来抢沙发吧