Panel Authentication
All API requests from the Panel to Wings must include a valid authentication token in theAuthorization header.
Token-Based Authentication
Wings uses a Bearer token system for Panel-to-Wings communication:/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: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:WebSocket Authentication Flow
- Client connects to
/api/servers/:server/ws - Client sends auth event with JWT token:
- Wings validates the token:
- Wings responds with authentication success:
Token Validation
Wings validates tokens using theParseToken function:
Token Denylist
Wings maintains a denylist to invalidate tokens:WebSocket Permissions
Permissions control what actions users can perform:SFTP Authentication
SFTP uses a separate authentication system with both password and public key support.SFTP Configuration
Username Validation
SFTP usernames follow the formatusername.serverid:
Authentication Methods
Wings supports two SFTP authentication methods: Password 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
router/router_download.go:75-110.
Security Best Practices
Token Storage
- Store tokens in
/etc/pterodactyl/config.ymlwith0600permissions - Use systemd
LoadCredentialfor enhanced security - Never commit tokens to version control
Token Rotation
Rotate the Wings token periodically:- Update token in Panel
- Update
/etc/pterodactyl/config.yml - Restart Wings:
systemctl restart wings
Network Security
- Use HTTPS/WSS for all connections (see SSL Certificates)
- Configure
trusted_proxiesif behind a proxy - Implement firewall rules (see Best Practices)
