Authentication (auth module)¶
The auth module of Zelly's Nexus provides account registration, password login, automatic verified Bedrock and Mojang premium onboarding, pre-login quarantine, and optional two-factor security.
Pre-login gate¶
While enabled: true in modules/auth/config.yml (default):
- Unauthenticated players are confined in an isolated void world (
isolated-world.enabled: true,isolated-world.name: "nexus_auth") and receive configured security effects (blindness,slowness,invulnerability). - Movement, block breaking/placing, interaction, item drops/pickups, damage, and inventory clicks are blocked until authenticated; chat is blocked while
security-effects.mute-chat: true(default). - By default,
/zn,/zn menu,/zn help,/zn authwork before login alongside any entry inallowed-commands(multi-word commands supported). Inside/zn auth, onlylogin,register,recovery reset,captcha,form, andmenuare permitted pre-login. - Credentials passed to
login,register,setpassword,changepassword,recovery,email,pin,totp,otp, andunregisterunder/zn authare masked as***in the server console log. - If the
authmodule fails to load on startup whileenabled: true, every join is refused until the next restart restores it.
Verified Bedrock auto-account and notice¶
With auto-login-bedrock: true and auto-register-bedrock: true (both default true):
- First join through Floodgate: When Floodgate verifies the Bedrock player's session (
FloodgateSupport.isFloodgateId/identify) and no Nexus account exists for that UUID, Nexus creates the account automatically tied to the Bedrock identity and marks it logged in. - First-join notice: Immediately after auto-creating the Bedrock account, Nexus displays the localized first-join notice (
auth.bedrock_auto_createdinenandes) telling the player in plain words that an account was created automatically, tied to their Bedrock identity, and how to set an optional password (/zn auth setpassword <password>or/zn -> Account). The notice is sent on first join only. - Subsequent joins: Existing Bedrock accounts log in automatically on subsequent joins without repeating the first-join notice.
- Linked Bedrock accounts: Follow
bedrock.linked-accounts: true(default). When set tofalse, linked accounts fall back to the regular password flow. - Offline impostor isolation and Floodgate absence: Accounts are keyed strictly by UUID string (
AuthService.users). Offline Java clients using a Floodgate-style prefix such as.PlayerNamereceive an offline v3 UUID, fail Floodgate verification, fail Mojang premium verification, and stay isolated insidenexus_auth. When Floodgate is absent, Bedrock auto-login never runs. Note: unit and integration tests verify this flow cleanly; live Floodgate/Geyser join remains unverified until an owner playtest. - Required Geyser and Floodgate prerequisites:
auto-login-bedrock: trueis safe only when Geyser authenticates Bedrock sessions through Xbox Live and Floodgate verifies them: - Set
auth-type: floodgatein Geyserconfig.yml(neveroffline). - Copy the exact same Floodgate
key.pemto Geyser (and across proxy and backend servers). - On Velocity or BungeeCord proxies, set
send-floodgate-data: truein Floodgate's proxy configuration so backend servers receive authenticatedFloodgateApisessions. - Keep Floodgate's
username-prefix(default.) consistent so offline Java accounts cannot collide with Bedrock usernames. - Staff password requirement: With
require-password-for-staff: true(default), operators (isOp()) and accounts holdingzn.adminorzn.auth.adminare excluded from Bedrock and Mojang premium auto-login and must authenticate with a password.
Mojang premium auto-register¶
With auto-login-premium: true and auto-register-premium: true (both default true):
- Online-mode servers, trusted proxies (
premium.proxy-trust: true), and verified Mojang session lookups (premium.direct-verification: true,premium.fail-closed: true) automatically create an account on first join and log the player in, showing a first-join notice explaining how to set an optional password (/zn auth setpassword). - Unverified connections claiming a known Mojang premium username follow
premium.name-protection:kickin defaultmodules/auth/config.yml(internal fallbackpasswordif omitted). Live Mojang online-mode joins are only verifiable on an online-mode playtest server. - Note on
premium.direct-verification: the shipped default remainstruepending live Mojang online-mode playtest verification (playtest step 7 decides whether it stays enabled by default). Toggling this key requires a full server restart.
Player security features¶
| Feature | Command | Summary |
|---|---|---|
| Register / Login | /zn auth register <pw>, /zn auth login <pw> [totp] [pin] |
Password length min-password-length: 4 to max-password-length: 64, max failures 5, lockout 60s |
| Set / Change password | /zn auth setpassword <pw>, /zn auth changepassword <old> <new> |
Sets a password on auto-created accounts or changes an existing password |
| Session memory | /zn auth remember <on\|off> |
Remembers login sessions for session-hours: 12 by matching address |
| Recovery code | /zn auth recovery generate, /zn auth recovery reset <code> <newPassword> |
Generates a one-time BCrypt-hashed recovery code and allows pre-login reset |
| Secondary PIN | /zn auth pin set <pin>, /zn auth pin verify <pin>, /zn auth pin reset |
Optional numeric secondary authentication step |
| TOTP 2FA | /zn auth totp setup, /zn auth totp confirm <code>, /zn auth totp disable |
Time-based one-time password authenticator flow |
| One-time code (OTP) | /zn auth otp generate, /zn auth otp verify <code> |
Temporary code expiring after otp-expiry-seconds: 300 |
| Recovery email | /zn auth email add <email>, /zn auth email change <email>, /zn auth email recover ... |
Stores recovery contact and issues reset codes |
| Captcha / Verification | /zn auth captcha [answer], /zn auth verification [code] |
Interactive verification challenge flows |
Administration¶
Operators (zn.auth.admin) can run /zn auth delacc <player>, premium [player], cracked <player>, freemium <player>, getlogs <player>, admin reload, admin purge [days], and admin forcelogin <player>. All mode transitions write audit entries with the acting administrator and previous/new mode.