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 without an account here is forced through verification. Cracked players cannot use a premium name: /register asks Mojang again and refuses a premium name, and refuses the registration while Mojang cannot answer (register-name-unverified). A name that already has a password account is not challenged; a premium player in that position moves over with /premium. /unpremium is 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. |
A premium player connecting under another capitalisation than Mojang's is refused and told the right spelling. /premium asks for confirmation and warns when the switch will change the player's UUID; /unpremium also clears the account's link to its Mojang UUID.
Behind a proxy
In proxy mode the verified profile is not handed over during login. It arrives out of band, over Redis or as a plugin message, sometimes a few ticks after the player has already joined. Showing the login prompt the instant they land is exactly what makes a premium player have to type /login once in a while.
premium:
# How long to wait for the profile the proxy delivers separately.
proxy-grace-ms: 2000
Only players the proxy is expected to verify are held back, so a cracked player with an account never sees the delay. Set it to 0 to disable the wait. The value is capped at 10 seconds.
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. |
A player who comes back under another UUID keeps their account. XCore recognises them while they log in — after a change of premium.uuid-mode, a switch between online and offline mode or a move behind a proxy — and XLogin moves the account onto the new UUID, with its password, sessions and 2FA, before they join. An account tied to a Mojang account only moves onto a connection Mojang has verified; otherwise only a password account of exactly that name, tied to no Mojang account, can move.
Changing premium.uuid-mode after players have data is destructive for other plugins. Premium players' UUIDs will change: XCore, XLogin, XBans and XAuctionHouse move their data onto the new ones, but what other plugins keep by UUID is orphaned. 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.