我已开设了一个支持 Discord,快来加入吧!
AlwaysAuth
AlwaysAuth 是 Minecraft 服务器的备用身份验证解决方案,确保即使 Mojang 的身份验证服务器停机,你的玩家仍能登录。与传统的离线模式变通方法不同,AlwaysAuth 在保持服务器处于 在线模式 (online mode) 的同时,提供了一种无缝的故障转移机制,连接到本地身份验证系统。
工作原理
AlwaysAuth 通过在 Minecraft 服务器和 Mojang 官方身份验证服务器之间插入一个 本地身份验证服务器 来运行:
- 当玩家尝试登录时,AlwaysAuth 首先将身份验证请求发送给 Mojang。
- 如果 Mojang 在线并作出响应,请求会像往常一样传回你的服务器。
- 如果 Mojang 离线,AlwaysAuth 会使用其本地备用系统来验证用户。
这种方法确保了:
- 即时故障转移: 无需等待定期检查。即使是短暂的宕机也能被无缝处理。
- 在线模式保持启用: 你无需将服务器切换到离线模式。
- 长时间停机期间的可靠身份验证: 长时间的宕机同样可以平滑处理。
AlwaysAuth 与 AlwaysOnline 对比
| 功能 |
AlwaysAuth |
AlwaysOnline |
| Spigot 支持 |
✅ |
✅ |
| Paper 支持 |
✅ |
✅ |
| BungeeCord 支持 |
❌* |
✅ |
| Velocity 支持 |
✅ |
✅ |
| Sponge 支持 |
❌** |
✅ |
| Fabric 支持 |
✅ |
❌ |
| NeoForge 支持 |
✅ |
❌ |
| 即时故障转移 |
✅ |
❌ |
| 在线模式保持启用 |
✅ |
❌ |
| 远程数据库支持 |
✅ |
✅ |
| 记录指标 |
❌ |
✅ |
| 多种安全模式 |
✅ |
❌ |
| 基于 IP 的验证 |
✅ |
✅ |
*BungeeCord 上无法设置自定义会话服务器,根据 md_5 的说法,将来也不会支持,详见
此处。我将创建一个涉及许多额外步骤的变通方案,但我建议切换到 Velocity 或使用独立版 jar 包。
**计划稍后添加 Sponge 支持,我只是对 SpongeAPI 不太熟悉。
主要优势
- 保持在线模式激活: 无需为了应对宕机而牺牲安全性。
- 支持多个平台: 适用于 Spigot、Paper、BungeeCord、Velocity、Fabric 和 NeoForge。
- 灵活的身份验证: 可选择多种安全模式和备用方法。
- 可靠: 轻松处理短暂的波动和长期的 Mojang 宕机事件。
安装
- 下载适用于你服务器平台的 AlwaysAuth 插件。
- 将插件放入服务器的
plugins(或等效)文件夹中。
- 重启服务器。
- 在配置文件中配置 AlwaysAuth,以启用本地身份验证、远程数据库支持或基于 IP 的验证等功能。
赋予自己 alwaysauth.admin 权限以访问相关命令
配置
AlwaysAuth 提供了一个灵活的配置文件,你可以在其中:
- 启用或禁用特定的备用方法。
- 设置远程数据库以实现跨服务器身份验证。
- 选择不同的安全模式。
###################################
# #
# Always Auth Configuration #
# #
###################################
# 是否应显示调试消息
# 这在独立版 jar 包中无效
debug=false
# 检查更新并在拥有 alwaysauth.admin 权限的人员(和控制台)加入时通知他们
check-updates=true
# 会话服务器的 IP 地址
# 如果设置为除 127.0.0.1 或 0.0.0.0(允许公开访问)以外的任何内容,则将其视为外部服务器
# 外部服务器意味着只需设置端口(以匹配该外部服务器),它将使用该端口进行身份验证。
# 请注意,目前如果你使用外部服务器,你将不会在服务器控制台中看到日志
ip-address=127.0.0.1
# 会话服务器的端口
port=8765
###########################
# Security Settings #
###########################
# 为授权服务器启用 HMAC-SHA256 签名验证
# 由于 Minecraft URL 处理限制,默认情况下当前已禁用
# 请改用防火墙规则或本地主机限制来进行访问控制
# 无论此设置如何,数据库加密均有效
authentication-enabled=true
# 数据库加密的密钥(自动生成)
# 请保密!用于加密数据库中的 IP 地址和个人资料数据
# 如果删除,也需要重置数据库!
# 要重新生成,请删除此行并重启服务器
secret-key=GENERATED ON STARTUP
###########################
# Fallback Settings #
###########################
# 当 Mojang 服务器宕机时启用会话备用
fallback-enabled=true
# 玩家在需要重新身份验证前可以保持离线的最大小时数(0 = 始终要求重新验证)
max-offline-hours=72
# 旧会话数据清理前的天数
cleanup-days=30
# 安全级别:'basic'(始终验证)或 'medium'(使用 max-offline-hours)
security-level=basic
# 上游会话服务器 URL
# 默认为 Mojang 的官方地址,但此选项可用于配合 Minehut 等外部服务器使用
upstream-server=https://sessionserver.mojang.com
###########################
# Database Settings #
###########################
# 数据库类型:h2、mysql 或 mariadb
database.type=h2
# 数据库主机(H2 不使用)
database.host=localhost
# 数据库端口(H2 不使用)
database.port=3306
# 数据库名称
database.name=minecraft
# 数据库用户名(H2 不使用)
database.username=root
# 数据库密码(H2 不使用)
database.password=
I have opened a support discord, join now!
AlwaysAuth
AlwaysAuth is a fallback authentication solution for Minecraft servers that ensures your players can log in even if Mojang's authentication servers experience downtime. Unlike traditional offline-mode workarounds, AlwaysAuth keeps your server in online mode while providing a seamless failover mechanism to a local authentication system.
How It Works
AlwaysAuth operates by inserting a local authentication server between your Minecraft server and Mojang’s official authentication servers:
- When a player tries to log in, AlwaysAuth first sends the authentication request to Mojang.
- If Mojang is online and responds, the request passes back to your server normally.
- If Mojang is offline, AlwaysAuth uses its local fallback system to verify the user.
This approach ensures:
- Instant failover: No waiting for periodic checks. Even short outages are handled seamlessly.
- Online mode stays enabled: You never have to switch your server to offline mode.
- Reliable authentication during extended downtime: Long outages are handled just as smoothly.
AlwaysAuth vs AlwaysOnline
| Feature |
AlwaysAuth |
AlwaysOnline |
| Spigot Support |
✅ |
✅ |
| Paper Support |
✅ |
✅ |
| BungeeCord Support |
❌* |
✅ |
| Velocity Support |
✅ |
✅ |
| Sponge Support |
❌** |
✅ |
| Fabric Support |
✅ |
❌ |
| NeoForge Support |
✅ |
❌ |
| Instant Failover |
✅ |
❌ |
| Online Mode Stays Enabled |
✅ |
❌ |
| Remote Database Support |
✅ |
✅ |
| Records Metrics |
❌ |
✅ |
| Multiple Security Modes |
✅ |
❌ |
| IP-Based Validation |
✅ |
✅ |
*There is no possible way to set a custom session server on bungeecord, nor ever will according to md_5, see
here. I will be creating a work around that involves many extra steps, however I recommend switching to Velocity or using the Standalone jar
**Sponge support is planned to be added later, I am just unfamiliar with the SpongeAPI
Key Benefits
- Keep Online Mode Active: No need to compromise security for downtime.
- Supports Multiple Platforms: Works with Spigot, Paper, BungeeCord, Velocity, Fabric, and NeoForge.
- Flexible Authentication: Choose from multiple security modes and fallback methods.
- Reliable: Handles both short blips and extended Mojang outages effortlessly.
Installation
- Download the AlwaysAuth plugin for your server platform.
- Place the plugin in your server’s
plugins (or equivalent) folder.
- Restart your server.
- Configure AlwaysAuth in the config file to enable features like local authentication, remote database support, or IP-based validation.
Give yourself the permission alwaysauth.admin to access the commands
Configuration
AlwaysAuth provides a flexible configuration file where you can:
- Enable or disable specific fallback methods.
- Set up remote databases for cross-server authentication.
- Choose between different security modes.
###################################
# #
# Always Auth Configuration #
# #
###################################
# Whether or not there should be debug message
# This won't work on the standalone jar
debug=false
# Check for updates and notify staff (and console) on join who have the permission alwaysauth.admin
check-updates=true
# The ip for the session server
# If set anything other than 127.0.0.1 or 0.0.0.0 (allows public access), it will treat as external server
# An external server means only port needs to be set (to match that external server) and it will use that to authenticate.
# Please note as of right now you will not see console logs on the server if you are using an external server
ip-address=127.0.0.1
# Port for the session server
port=8765
###########################
# Security Settings #
###########################
# Enable HMAC-SHA256 signature verification for authorized servers
# Currently DISABLED by default due to Minecraft URL handling limitations
# Use firewall rules or localhost restriction for access control instead
# Database encryption works regardless of this setting
authentication-enabled=true
# Secret key for database encryption (auto-generated)
# KEEP THIS SECRET! Used to encrypt IP addresses and profile data in database
# If deleted database will need to also be reset!
# To regenerate, delete this line and restart the server
secret-key=GENERATED ON STARTUP
###########################
# Fallback Settings #
###########################
# Enable session fallback when Mojang servers are down
fallback-enabled=true
# Maximum hours a player can stay offline before requiring re-authentication (0 = always require)
max-offline-hours=72
# Days before old session data is cleaned up
cleanup-days=30
# Security level: 'basic' (always verify) or 'medium' (use max-offline-hours)
security-level=basic
# Upstream Session Server URL
# Default is Mojang's official one but this option is here to work with things like minehut's external servers
upstream-server=https://sessionserver.mojang.com
###########################
# Database Settings #
###########################
# Database type: h2, mysql, or mariadb
database.type=h2
# Database host (not used for H2)
database.host=localhost
# Database port (not used for H2)
database.port=3306
# Database name
database.name=minecraft
# Database username (not used for H2)
database.username=root
# Database password (not used for H2)
database.password=
评论 0
登录后参与评分
还没有评论,来抢沙发吧