Premium Auto-Login
How It Works
Premium auto-login lets Mojang-authenticated players skip /login entirely. Their identity is verified cryptographically — no password needed.
There are two modes depending on your server setup:
Standalone (no proxy)
XLogin injects a handler into the server's Netty pipeline that intercepts login packets:
- Player connects (offline-mode server).
- XLogin intercepts the
LoginStartpacket. - Checks if the player should be verified (database flag or Mojang API).
- If premium: sends an
EncryptionRequestwith an RSA public key. - Client authenticates with Mojang and responds with
EncryptionResponse. - XLogin decrypts the shared secret, enables AES/CFB8 encryption.
- Verifies with Mojang's
hasJoinedsession server. - If verified: stores UUID + textures, player joins and is auto-logged.
Behind a proxy (Velocity / BungeeCord)
The Netty injection cannot be used behind a proxy — the proxy would interpret it as online-mode. XLogin on the proxy handles verification directly:
- Player connects to the proxy.
- XLogin checks the database for
premium=1(or Mojang API in strict mode). - If premium: forces online-mode, proxy does Mojang handshake.
- Verified profile sent to backend via Redis (instant) + plugin messaging (fallback).
- Player is routed directly to lobby (skips auth server entirely).
See the Proxy Setup guide for detailed installation instructions.
Strict Mode vs Opt-In Mode
| Mode | Config | Behavior |
|---|---|---|
| STRICT | premium.mode: "strict" | Any Mojang username is forced through verification. Cracked players cannot use a premium name. /premium and /unpremium commands are disabled. Best for maximum security. |
| OPT-IN | premium.mode: "opt-in" | Only players who used /premium are verified. Everyone /registers first, then can opt-in. /premium and /unpremium commands available. Best for mixed servers. |
UUID Modes
| Mode | Config | Behavior |
|---|---|---|
| OFFLINE | premium.uuid-mode: "OFFLINE" | All players use offline UUIDs. Simple and safe. Default. |
| REAL | premium.uuid-mode: "REAL" | Premium players get their real Mojang UUID. Enables cosmetics on Lunar/Badlion. Cracked players still use offline UUIDs. |
Changing premium.uuid-mode after players have data is destructive. Premium players' UUIDs will change, orphaning their data. Set this once at server setup.
Username Change Migration
When a premium player changes their Mojang username, their offline UUID changes. XLogin detects this automatically:
- Player connects with their new username.
- Mojang handshake verifies — same Mojang UUID as before.
- XLogin finds the old account via
mojang_uuidcolumn. - Migrates
player_uuidin accounts, sessions, and 2FA tables. - Publishes a
MIGRATEsync event across the network.
No data is lost — password, premium flag, 2FA, email, sessions are all preserved.
This only applies in premium.uuid-mode: "OFFLINE". In REAL mode, the Mojang UUID is used directly, so username changes don't affect the UUID.