Online Mode
Online mode determines how Gate authenticates players connecting to your network. This is one of the most critical security settings for your Minecraft proxy.What is Online Mode?
Online mode controls whether Gate verifies player identities with Mojang’s authentication servers:- Online Mode (Enabled): Gate authenticates every player with Mojang’s session servers, ensuring that only legitimate Minecraft account holders can connect.
- Offline Mode (Disabled): Gate skips authentication, allowing anyone to connect with any username. This is not recommended for production servers.
Gate defaults to online mode enabled (
onlineMode: true) for security reasons.Configuration
The online mode setting is configured in yourconfig.yml:
Online Mode (Recommended)
- Player connects to Gate
- Gate generates an authentication challenge
- Player’s client contacts Mojang’s session servers
- Gate verifies the response with Mojang
- Upon successful verification, player is authenticated
- Prevents username spoofing
- Ensures only legitimate Minecraft account holders can join
- Protects against unauthorized access
- Maintains consistent player UUIDs across servers
Offline Mode
- No authentication with Mojang servers
- Players can choose any username
- UUIDs are generated based on username (not account)
- Anyone can impersonate admins or other players
- Local testing and development
- Private LAN networks
- Offline gameplay environments
- Testing with cracked clients (use with extreme caution)
Authentication Flow
Gate uses RSA encryption and secure authentication flows to verify players:- Connection Establishment: Player initiates connection to Gate
- Encryption Request: Gate sends public key to client
- Encryption Response: Client encrypts shared secret with public key
- Session Verification: Gate verifies session with Mojang’s API at
https://sessionserver.mojang.com/session/minecraft/hasJoined - Authentication Success: Player is granted access with verified UUID
The authentication flow uses AES-CFB8 encryption to secure the connection after the initial handshake.
Custom Authentication Servers
You can customize the Mojang session server URL for alternative authentication providers:- Using alternative authentication services
- Implementing custom authentication logic
- Testing authentication flows in development
Online Mode with Existing Players
Gate provides a setting to handle conflicts when premium players join:true:
- A premium account holder can join and disconnect the cracked player using their name
- Useful for servers transitioning from offline to online mode
- Helps enforce legitimate account usage
Backend Server Configuration
When Gate is in online mode, your backend servers should be configured appropriately:Recommended Setup
Backend servers should run in offline mode because Gate handles authentication: Spigot/Paper (server.properties):
Gate authenticates players, then forwards their verified information to backend servers using a forwarding mode. This is why backend servers can safely run in offline mode.
Why Backend Servers Should Be Offline
- Avoid Double Authentication: Gate already authenticated the player
- Faster Connections: No redundant Mojang API calls
- Consistent Player Data: Gate manages the authenticated session
- Proper Forwarding: Player info (UUID, IP) is forwarded securely
Security Best Practices
For Production Servers
- Enable online mode:
onlineMode: true - Use modern forwarding: Configure Velocity forwarding with a secret
- Protect backend servers: Configure firewalls to only accept connections from Gate
- Enable rate limiting: Protect against brute-force authentication attempts
- Monitor authentication: Enable logging for authentication events
For Development Environments
Offline mode is acceptable for local development, but never deploy offline mode to production.
Rate Limiting Authentication
Gate includes built-in rate limiting for login attempts:- Brute-force authentication attacks
- Excessive Mojang API requests
- Denial of service through authentication spam
Troubleshooting
Players Can’t Connect (Online Mode)
Symptoms: “Failed to verify username” or “Invalid session” Solutions:- Verify Mojang services are online: https://status.mojang.com/
- Check firewall allows outbound HTTPS to Mojang
- Ensure players are using legitimate Minecraft accounts
- Verify
sessionServerUrlis correct if customized
Players Can Impersonate Others
Cause: Offline mode is enabled Solution: Enable online mode:Backend Server Authentication Errors
Cause: Backend server is in online mode while Gate is forwarding Solution: Set backend servers to offline mode:Migration Guide
Migrating from Offline to Online Mode
Steps:- Backup everything: Player data, worlds, databases
- Enable online mode:
- Convert player data: Use a UUID migration plugin like:
- UUIDConverter
- Custom migration scripts
- Update permissions: Reconfigure permissions with new UUIDs
- Test thoroughly: Verify all player data migrated correctly
- Communicate: Inform players about the change
Consider enabling
onlineModeKickExistingPlayers: true during migration to help enforce legitimate accounts.Related Topics
- Forwarding Modes - Secure player info forwarding
- Key Authentication - 1.19+ security features
- DDoS Protection - Rate limiting and quota management

