Authentication Overview
The server supports two types of client authentication:- Observer Authentication (
obs_logon) - For main game observers that create matches - Auxiliary Authentication (
aux_logon) - For additional clients like player cameras
Observer Client Authentication
Observer clients authenticate when creating a new match. The authentication process validates access keys, client versions, and match availability.Authentication Flow
Client sends obs_logon event
Client sends authentication data including access key, group code, and team information.
Server validates packet format
The server checks that the packet type is
DataTypes.AUTH. Invalid packets are rejected immediately.Server validates client version
The server ensures the client version is compatible with the server version.Source:
src/connector/websocketIncoming.ts:84-98Server creates match
If all validations pass, the server attempts to create a new match with the provided group code.
Access Key Validation
The server validates access keys through a multi-tier system:src/connector/websocketIncoming.ts:275-287
Key Validity Response
When using backend verification, the key validation includes organization information:- 200: Key is valid with organization details
- 401: Key does not exist
- 403: Key has expired
src/connector/databaseConnector.ts:22-61
Auxiliary Client Authentication
Auxiliary clients (like player cameras) authenticate using match IDs instead of creating new matches.Auxiliary Authentication Flow
Server validates packet and version
Similar to observer authentication, validates packet type and client version.Source:
src/connector/websocketIncoming.ts:166-191Server finds match by ID
The server searches for an active match with the provided match ID.Source:
src/connector/websocketIncoming.ts:193-209Auxiliary authentication does not require access key validation. The match ID itself serves as the authentication token.
Group Codes and Secrets
Group Codes
Group codes are unique identifiers for matches, typically 6 characters long. They must be:- Unique across active matches
- Provided by the observer client during authentication
- Used to identify which match data belongs to
Group Secrets
When a match is created, the server generates a group secret:src/controller/MatchController.ts:42-67
The group secret allows reconnection to an existing match:
Organization and Supporter Verification
When backend verification is enabled, the server validates organization access and supporter status:src/connector/websocketIncoming.ts:115-119
The backend checks supporter status through a separate endpoint:
src/connector/databaseConnector.ts:134-150
Environment Variables
Configure authentication behavior with these environment variables:REQUIRE_AUTH_KEY
"false" to disable access key validation entirely. Useful for development.
AUTH_KEY
USE_BACKEND
BACKEND_URL and BACKEND_TOKEN
SUPPORTER_CHECK_URL
Authentication Examples
Development (No Auth)
Static Key
Backend Verification
Common Authentication Errors
| Error Message | Cause | Solution |
|---|---|---|
| ”Invalid packet.” | Packet type mismatch | Ensure type field is correct |
| ”Client version X is not compatible” | Version mismatch | Update client or server |
| ”Invalid Key” / “Expired Key” | Access key validation failed | Check key validity with backend |
| ”Game with Group Code X exists and is still live.” | Group code collision with wrong secret | Use different group code or correct secret |
| ”Game with Match ID X not found.” | Match doesn’t exist (auxiliary auth) | Verify match ID is correct |