Xgamingserver
Home Hytale Hytale Server Authentication Guide: OAuth2 Device Code Setup

Hytale Server Authentication Guide: OAuth2 Device Code Setup

Skip the Authentication Setup

Our Hytale servers come pre-authenticated and ready to play.

Get Hytale Server Hosting →

Hytale dedicated servers require authentication to communicate with Hytale services and validate players. This guide explains how to authenticate your server using the built-in console commands.

Why Authentication is Required

Server authentication allows your Hytale server to:

  • Create game sessions for players
  • Validate players joining the server
  • Access game assets and version information
  • Communicate with Hytale’s backend services
Note: Each Hytale game license can authenticate up to 100 concurrent servers. If you need more, purchase additional licenses or apply for a Game Server Provider account.

Authentication Using Console Commands

The easiest way to authenticate your server is using the built-in console commands.

Available Authentication Commands

Command Description
/auth login device Start device code flow (recommended for headless servers)
/auth login browser Start browser PKCE flow (requires desktop environment)
/auth select <number> Select a game profile when multiple are available
/auth status Check current authentication status
/auth cancel Cancel an in-progress authentication flow
/auth logout Clear authentication and terminate session

Device Code Flow (Recommended)

This method works on headless servers without a GUI.

Step 1: Start Authentication

In the server console, run:

/auth login device

Step 2: Authorize in Browser

You’ll see output like:

===================================================================
DEVICE AUTHORIZATION
===================================================================
Visit: https://accounts.hytale.com/device
Enter code: ABCD-1234
Or visit: https://accounts.hytale.com/device?user_code=ABCD-1234
===================================================================
Waiting for authorization (expires in 900 seconds)...

Step 3: Complete Authorization

  1. Open the URL in your browser on any device
  2. Log in to your Hytale account
  3. Enter the code (or use the direct link with code)
  4. Authorize the server

Step 4: Confirmation

The server will display:

Authentication successful! Mode: OAUTH_DEVICE

Token Lifecycle

Understanding token expiration is important for server uptime:

Token Type TTL Notes
OAuth Access Token 1 hour Used to create game sessions
OAuth Refresh Token 30 days Used to obtain new access tokens
Game Session 1 hour Auto-refreshed 5 minutes before expiry

The server automatically refreshes tokens before they expire, so you typically don’t need to re-authenticate unless the server is offline for an extended period.

Check Authentication Status

To verify your server is authenticated:

/auth status

Troubleshooting Authentication

Token Validation Failed

If you see “Token validation failed. Server starting unauthenticated.” check:

  • Expired tokens (re-run /auth login device)
  • Invalid token signature
  • Missing required scope

Session Limit Reached

If you get a 403 Forbidden error when creating sessions, you’ve hit the 100-server limit per account. Options:

  • Stop unused servers
  • Purchase additional Hytale licenses
  • Apply for Game Server Provider status

Re-authentication Required

Re-authenticate if:

  • Server was offline for more than 30 days
  • You logged out manually
  • Account credentials changed

For Game Server Providers

If you’re a hosting provider running many servers, you can apply for the sessions.unlimited_servers entitlement which removes the 100-server limit. Contact Hytale Support with your company details.

Fully Managed Authentication

Our Hytale servers handle authentication automatically. Just play.

Get Hytale Server Hosting →

Your Header Sidebar area is currently empty. Hurry up and add some widgets.