Skip to main content
Wings implements multiple authentication layers to secure communication between the Panel, users, and server instances. This page covers the authentication mechanisms used throughout the system.

Panel Authentication

All API requests from the Panel to Wings must include a valid authentication token in the Authorization header.

Token-Based Authentication

Wings uses a Bearer token system for Panel-to-Wings communication:
The authentication token is configured in /etc/pterodactyl/config.yml:

Token Validation

Wings validates incoming requests using constant-time comparison to prevent timing attacks:

Environment Variables

Tokens can be loaded from environment variables or files:
Or using systemd credentials:
See config/config.go:844-865 for the token expansion logic.

WebSocket Authentication

WebSocket connections use JWT (JSON Web Tokens) for authentication, separate from the Panel API token.

JWT Token Structure

The WebSocket JWT payload includes:

Token Generation

The Panel generates JWTs signed with HMAC-SHA256:
The JWT algorithm is initialized with the Wings token:

WebSocket Authentication Flow

  1. Client connects to /api/servers/:server/ws
  2. Client sends auth event with JWT token:
  1. Wings validates the token:
  1. Wings responds with authentication success:

Token Validation

Wings validates tokens using the ParseToken function:

Token Denylist

Wings maintains a denylist to invalidate tokens:
To deny all tokens for a user:

WebSocket Permissions

Permissions control what actions users can perform:
Permission checking:

SFTP Authentication

SFTP uses a separate authentication system with both password and public key support.

SFTP Configuration

Username Validation

SFTP usernames follow the format username.serverid:

Authentication Methods

Wings supports two SFTP authentication methods: Password Authentication:
Public Key Authentication:

Panel Validation

Wings validates SFTP credentials against the Panel:

SFTP Permissions

Signed Download URLs

File and backup downloads use one-time JWT tokens:

One-Time Token Validation

This ensures download URLs can only be used once, see router/router_download.go:75-110.

Security Best Practices

Token Storage

  • Store tokens in /etc/pterodactyl/config.yml with 0600 permissions
  • Use systemd LoadCredential for enhanced security
  • Never commit tokens to version control

Token Rotation

Rotate the Wings token periodically:
  1. Update token in Panel
  2. Update /etc/pterodactyl/config.yml
  3. Restart Wings: systemctl restart wings

Network Security

Rate Limiting

WebSocket connections include rate limiting:
This prevents abuse by limiting to 10 messages per 200ms.