This document provides a comprehensive reference for all configuration options available in NexAuth. Use this as a reference when setting up or customizing your NexAuth installation.
Configuration Types
NexAuth uses HOCON (Human-Optimized Config Object Notation) format for configuration files. HOCON is:
Human-readable
Supports comments
Allows comments on same line
Supports includes and substitutions
Key Features
Type-safe: Values are validated against expected types
Default values: Sensible defaults for all options
Validation: Configuration is validated on load
Reloadable: Can be reloaded without restart (/nexauth reload)
Configuration File Location
The configuration file location depends on your setup:
Velocity Proxy
BungeeCord/Waterfall Proxy
Paper Backend Server
Custom Location
You can specify a custom location using system property:
Configuration Format
Basic Syntax
String Values
Arrays and Lists
Includes
Substitutions
Complete Configuration Reference
Here's the complete structure of the NexAuth configuration file:
Database Configuration
MySQL
Pool Settings Explained:
maximumPoolSize: Maximum number of connections in pool
minimumIdle: Minimum number of idle connections
connectionTimeout: Timeout when getting connection (ms)
idleTimeout: Close connections after idle time (ms)
# Comments start with #
# Key-value pairs
key = value
# Nested objects
database {
host = "localhost"
port = 3306
}
# Arrays
servers = ["lobby-1", "lobby-2"]
# Strings
name = "value"
# Numbers
port = 3306
# Booleans
enabled = true
# Placeholders
username = "${DATABASE_USERNAME}" # From environment variable
# Regular string
name = "Steve"
# String with special characters
motd = "Welcome to \"My Server\"!"
# Multiline string
description = """
This is a
multiline string
"""
# Raw string (no escaping)
regex = '''[a-zA-Z0-9_]+'''
# Simple array
servers = ["lobby-1", "lobby-2", "lobby-3"]
# Array of objects
servers = [
{
name = "lobby-1"
ip = "127.0.0.1"
port = 25565
}
]
# Include another file
include "database.conf"
include "servers.conf"
# Use value from another key
default_port = 3306
mysql_port = ${default_port}
# Use environment variable
db_password = "${DB_PASSWORD}"
# Use system property
config_path = "${?CUSTOM_CONFIG_PATH}" # Optional, won't error if not set
# NexAuth Configuration
# Full reference: https://github.com/xreatlabs/NexAuth/wiki
# ==========================================
# DATABASE CONFIGURATION
# ==========================================
database {
# Database provider type
# Options: nexauth-mysql, nexauth-postgresql, nexauth-sqlite
# Migration providers: authme-mysql, fastlogin-mysql, etc.
type = "nexauth-mysql"
# MySQL configuration
mysql {
host = "localhost"
port = 3306
database = "nexauth"
username = "nexauth"
password = "your-password"
# Connection pool settings
pool {
maximumPoolSize = 10
minimumIdle = 5
connectionTimeout = 5000
idleTimeout = 600000
maxLifetime = 1800000
leakDetectionThreshold = 60000
}
# SSL/TLS settings
ssl {
enabled = false
# ssl-cert, ssl-key, ssl-ca paths if needed
}
# Additional connection properties
properties {
useSSL = false
allowPublicKeyRetrieval = true
}
}
# PostgreSQL configuration
postgresql {
host = "localhost"
port = 5432
database = "nexauth"
username = "nexauth"
password = "your-password"
pool {
maximumPoolSize = 10
minimumIdle = 5
connectionTimeout = 5000
idleTimeout = 600000
maxLifetime = 1800000
}
ssl {
enabled = false
mode = "prefer" # disable, require, verify-ca, verify-full
cert = "/path/to/cert"
}
properties {
ssl = false
}
}
# SQLite configuration
sqlite {
file = "data/nexauth.db"
# WAL mode for better concurrency
wal = true
# Timeout for database locks (ms)
busyTimeout = 30000
}
}
# ==========================================
# CRYPTO CONFIGURATION
# ==========================================
crypto {
# Default hashing algorithm
# Options: argon2id, bcrypt2a, sha256, sha512, logit-sha256
default-provider = "argon2id"
# Argon2ID settings (RECOMMENDED)
argon2id {
# Number of iterations (higher = more secure, slower)
# Recommended: 3-4 for modern servers
iterations = 3
# Memory usage in KB (higher = more secure, more memory)
# Recommended: 65536 (64 MB) for servers with 8GB+ RAM
memory = 65536
# Parallelism degree (CPU threads to use)
# Recommended: 1-2
parallelism = 1
# Hash length (bytes)
hash-length = 32
}
# BCrypt2A settings
bcrypt2a {
# Cost factor (2^cost iterations)
# Recommended: 12 for modern servers
# Higher = more secure, slower
cost = 12
# Minor version (2a, 2b, 2y)
variant = "2a"
}
# SHA-256 settings (LEGACY - for migration only)
sha256 {
# Iterations (for salted SHA)
iterations = 1
# WARNING: SHA-256 is not secure for passwords!
# Only use for migration from old plugins
# Use argon2id or bcrypt2a for new installations
}
# SHA-512 settings (LEGACY - for migration only)
sha512 {
iterations = 1
# WARNING: SHA-512 is not secure for passwords!
# Only use for migration from old plugins
}
# LOGIT-SHA-256 settings
logit-sha256 {
iterations = 10000
# Custom algorithm used by LogIt plugin
# Use only for migration
}
}
# ==========================================
# AUTHENTICATION SETTINGS
# ==========================================
authentication {
# Maximum login attempts before temporary ban
max-login-attempts = 5
# Temporary ban duration in milliseconds
# Default: 300000 (5 minutes)
temp-ban-duration = 300000
# Session timeout in milliseconds
# After this time, player must re-authenticate
# Default: 3600000 (1 hour)
session-timeout = 3600000
# Minimum password length
minimum-password-length = 8
# Maximum password length
maximum-password-length = 128
# Require password confirmation on registration
require-password-confirmation = true
# Allow registration
allow-registration = true
# Auto-login premium players
auto-login-premium = true
# Allow changing username after registration
allow-username-change = false
# Password validation rules
password-rules {
# Require uppercase letters
require-uppercase = false
# Require lowercase letters
require-lowercase = false
# Require numbers
require-numbers = false
# Require special characters
require-special = false
# Maximum repeated characters
max-repeated-chars = 3
}
# Name validation
name-validation {
# Minimum name length
min-length = 3
# Maximum name length
max-length = 16
# Regex pattern for valid names
pattern = "[a-zA-Z0-9_]+"
# Check case sensitivity
case-sensitive = false
# Allow digits
allow-digits = true
}
}
# ==========================================
# SERVER CONFIGURATION
# ==========================================
servers {
# Limbo servers (for unauthenticated players)
# Create these servers before starting!
limbo = ["limbo"]
# Lobby server configuration
lobby {
# Default lobby server
root = "lobby"
# Additional lobby servers (for load balancing)
# Format: "server-name" = "server-display-name"
lobbies = ["lobby-1", "lobby-2"]
}
# Remember and return to last server after authentication
remember-last-server = true
# Default server for new players (if remember-last-server is false)
default-server = "lobby"
# Server selection strategy
# Options: round-robin, least-players, random, hash
selection-strategy = "round-robin"
# Backend server protection
protection {
# Enable BungeeGuard
bungeeguard-enabled = false
# Allowed proxy IPs (for backend servers)
allowed-proxy-ips = []
# Verify player authenticity
verify-players = true
}
# MultiProxy configuration
multiproxy {
# Enable MultiProxy support
enabled = false
# This proxy's ID
proxy-id = "proxy-1"
# Shared secret for proxy communication
shared-secret = "your-secret"
# List of all proxies
proxies = ["proxy-1", "proxy-2"]
}
}
# ==========================================
# TWO-FACTOR AUTHENTICATION (2FA)
# ==========================================
totp {
# Enable/disable 2FA
enabled = false
# Issuer name (shown in authenticator app)
# Recommended: Your server name
issuer = "NexAuth"
# Code length (6 is standard)
code-length = 6
# Time window in seconds (30 is standard)
# Allows for slight time drift
time-window = 30
# Number of recovery codes
recovery-codes-count = 10
# Allow users to disable 2FA
allow-disable = true
# Enforce 2FA for all users (dangerous!)
enforce = false
# QR code generation
qr {
# Enable QR code display
enabled = true
# QR code size in pixels
size = 300
# Image format: PNG, JPEG
format = "PNG"
# QR code error correction level
# Options: L, M, Q, H
error-correction = "M"
}
}
# ==========================================
# EMAIL CONFIGURATION
# ==========================================
mail {
# Enable/disable email functionality
enabled = false
# SMTP Server Settings
host = "smtp.gmail.com"
port = 587
username = "[email protected]"
password = "your-app-password"
# From address
from = "NexAuth <[email protected]>"
# Use TLS (recommended for port 587)
use-tls = true
# Use SSL (for port 465)
use-ssl = false
# Connection timeout in milliseconds
connection-timeout = 5000
# Read timeout in milliseconds
read-timeout = 10000
# Email templates
templates {
# Verification email template
verification {
subject = "Verify your NexAuth account"
content = """
<html>
<body>
<h2>Verify Your Account</h2>
<p>Hello,</p>
<p>Your verification code is: <strong>{code}</strong></p>
<p>Enter this code in the game to verify your email.</p>
<p>Best regards,<br>NexAuth</p>
</body>
</html>
"""
format = "HTML" # Options: TEXT, HTML
}
# Password reset email template
password-reset {
subject = "NexAuth Password Reset"
content = """
<html>
<body>
<h2>Password Reset</h2>
<p>Hello,</p>
<p>Your password reset code is: <strong>{code}</strong></p>
<p>Use this code to reset your password in the game.</p>
<p>If you did not request this, please ignore this email.</p>
</body>
</html>
"""
format = "HTML"
}
# Custom variables available:
# {code} - The verification/reset code
# {username} - The player's username
# {server} - Server name
# {ip} - Player's IP address
}
# Rate limiting
rate-limiting {
# Max emails per hour per IP
max-per-hour = 10
# Cooldown between emails in seconds
cooldown = 60
}
}
# ==========================================
# LOGGING CONFIGURATION
# ==========================================
logging {
# Log level
# Options: TRACE, DEBUG, INFO, WARN, ERROR, OFF
level = "INFO"
# Log to file
file = "logs/nexauth.log"
# Max log file size in MB
max-file-size = 10
# Number of backup files to keep
max-backup-files = 5
# Enable/disable console logging
console = true
# Debug mode (enables verbose logging)
debug = false
# Log patterns
patterns {
# Console log pattern
console = "[{yyyy-MM-dd HH:mm:ss}] [{LEVEL}] [{COMPONENT}] {MESSAGE}{EXCEPTION}"
# File log pattern
file = "{yyyy-MM-dd HH:mm:ss.SSS} [{LEVEL}] [{COMPONENT}] {MESSAGE}{EXCEPTION}"
}
# Component names for logging
components {
database = "Database"
auth = "Auth"
events = "Events"
config = "Config"
}
# Colored console output
console-colors = true
}
# ==========================================
# SESSION MANAGEMENT
# ==========================================
session {
# Enable/disable session system
enabled = true
# Session timeout in milliseconds
# After this time, player must re-authenticate
timeout = 3600000
# Remember login duration in milliseconds
# Max time to remember login (30 days = 2592000000)
remember-duration = 2592000000
# IP validation
ip-validation {
# Allow changing IP during session
allow-ip-change = false
# Treat different IPs as new session
strict-mode = true
}
# Session storage
storage {
# Session backend: database, file
backend = "database"
# File location (if using file backend)
file = "data/sessions.json"
# Clean expired sessions
cleanup-enabled = true
# Cleanup interval in minutes
cleanup-interval = 60
}
}
# ==========================================
# UPDATES
# ==========================================
updates {
# Check for updates on startup
check-for-updates = true
# Update check interval in hours
check-interval = 24
# Notify about dev builds
notify-dev-builds = false
# Update channel
# Options: release, beta, dev
channel = "release"
}
# ==========================================
# PERFORMANCE
# ==========================================
performance {
# Async operation settings
async {
# Thread pool size
# Default: CPU cores
pool-size = 4
# Queue size
queue-size = 10000
# Keep alive time in seconds
keep-alive = 60
}
# Caching
cache {
# Enable caching
enabled = true
# User cache size
user-cache-size = 1000
# Server cache size
server-cache-size = 100
# Cache expiration in milliseconds
expiration = 300000
}
# Database query optimization
database-optimization {
# Use prepared statements
prepared-statements = true
# Query timeout in seconds
query-timeout = 30
# Enable query logging
query-logging = false
}
}
# ==========================================
# SECURITY
# ==========================================
security {
# Encryption settings
encryption {
# Enable config encryption
enabled = false
# Encryption key (if enabled)
key = "your-encryption-key"
}
# Password security
password-security {
# Enable forbidden passwords list
forbidden-passwords-enabled = true
# Forbidden passwords file location
forbidden-passwords-file = "forbidden-passwords.txt"
# Check password strength
check-strength = true
# Minimum strength score (0-4)
min-strength-score = 2
}
# Rate limiting
rate-limiting {
# Enable rate limiting
enabled = true
# Max requests per minute per IP
max-requests-per-minute = 60
# Burst capacity
burst-capacity = 10
# Block duration in seconds
block-duration = 300
}
# CSRF protection
csrf {
# Enable CSRF tokens
enabled = true
# Token timeout in minutes
timeout = 10
}
}
# ==========================================
# INTEGRATIONS
# ==========================================
integrations {
# Floodgate (Bedrock) integration
floodgate {
# Enable Floodgate support
enabled = false
# Use Floodgate UUIDs
use-floodgate-uuids = true
# Prefix for Bedrock player names
prefix = ""
}
# LuckPerms integration
luckperms {
# Enable LuckPerms context provider
enabled = false
# Context prefix
context-prefix = "nexauth:"
}
# PlaceholderAPI integration
placeholderapi {
# Enable PlaceholderAPI placeholders
enabled = false
# Update interval in milliseconds
update-interval = 1000
}
# Vault integration
vault {
# Enable Vault economy integration
enabled = false
}
# Discord integration
discord {
# Enable Discord webhook notifications
enabled = false
# Webhook URL
webhook-url = ""
# Notify on authentication
notify-auth = true
# Notify on failed login
notify-failed-login = true
# Notify on password change
notify-password-change = true
}
}
# ==========================================
# MIGRATION CONFIGURATION
# ==========================================
migration {
# Enable migration
enabled = false
# Source database type
from = "authme-mysql"
# Migration batch size
batch-size = 100
# Old database connection
old-database {
mysql {
host = "localhost"
port = 3306
database = "old_db"
username = "old_user"
password = "old_pass"
}
postgresql { /* ... */ }
sqlite {
file = "/path/to/old.db"
}
}
# Migration options
options {
# Convert hashes to new algorithm
convert-hashes = true
# Default password for users without password
default-password = "changeme123"
# Skip premium users during migration
skip-premium = false
# Keep old database intact
keep-old-database = true
# Validate data during migration
validate-data = true
}
}
# ==========================================
# LOCALIZATION
# ==========================================
localization {
# Default language
# Options: en, de, fr, es, pt, ru, zh-CN, etc.
default-language = "en"
# Enable fallback to English for missing translations
fallback-to-english = true
# Message cache size
cache-size = 1000
# Reload messages from file
auto-reload = false
}
# ==========================================
# METRICS
# ==========================================
metrics {
# Enable bStats metrics
enabled = true
# Report player count
report-player-count = true
# Report plugin version
report-version = true
# Custom metrics
custom {
enabled = false
metric-id = "your-metric-id"
}
}
# Old LibreLogin config
authme {
max-attempts = 3
session-timeout = 3600
}
# Migrated to NexAuth
authentication {
max-login-attempts = 3
session-timeout = 3600000 # Convert to milliseconds
}
config {
version = 3
last-updated = "2025-10-30"
}
# Required fields
database {
type = "nexauth-mysql" # Must be valid type
mysql {
host = "localhost" # Must not be empty
port = 3306 # Must be 1-65535
database = "nexauth" # Must not be empty
username = "user" # Must not be empty
password = "pass" # Must not be empty
}
}
authentication {
max-login-attempts = 5 # Must be 1-20
temp-ban-duration = 300000 # Must be > 0
session-timeout = 3600000 # Must be > 0
minimum-password-length = 8 # Must be 4-128
maximum-password-length = 128 # Must be >= minimum
}
servers {
limbo = ["limbo"] # List must not be empty
lobby {
root = "lobby" # Must not be empty
}
}
crypto {
default-provider = "argon2id" # Must be registered provider
argon2id {
iterations = 3 # Must be 1-10
memory = 65536 # Must be 1024-1048576
parallelism = 1 # Must be 1-4
}
}
# Wrong
database {
type = "mysql" # Invalid!
}
# Correct
database {
type = "nexauth-mysql" # Valid
}
# Wrong
database {
mysql {
port = 70000 # Too high!
}
}
# Correct
database {
mysql {
port = 3306 # Valid MySQL port
}
}
[INFO] [NexAuth] Using database: nexauth-mysql
[INFO] [NexAuth] Default crypto provider: argon2id
[INFO] [NexAuth] Max login attempts: 5
# Backup current config first!
cp plugins/NexAuth/config.conf config.conf.backup
# Reset
rm plugins/NexAuth/config.conf
# Start server - new default config will be created
java -jar velocity.jar
# Git
git add config.conf
# But exclude sensitive data!
# Use environment variables for passwords
# Custom setting for my server
custom {
# This enables premium rewards
premium-rewards = true
# Contact: [email protected] for questions
}
# config.conf
include "database.conf"
include "servers.conf"
include "features.conf"
# Before editing
cp config.conf config.conf.backup.$(date +%Y%m%d)
# After changes
cp config.conf config.conf.new
# Test new config
# If good, keep it
# If bad, restore backup