Skip to content

Testing Minecraft Login and AuthMe Security

Test AuthMe and other Minecraft login plugins. Check password rules, brute-force limits, sessions, and premium login, then load test registration with bots.

Pistonmaster7 min read

Understanding Minecraft Authentication

Minecraft has two authentication modes. Plugins add password login to the offline one.

The short version: use online mode if you can. If you must run offline mode, install AuthMe, switch the hash to BCRYPT, turn on tempbans, and test registration, wrong passwords, sessions, and name case by hand. Then connect bots to check that registration and login hold up when many players join at once. Run these tests only on a server that you own or have permission to test.

Online vs Offline Mode

Online mode (online-mode=true in server.properties) is the default and the one you want. The server talks to Mojang/Microsoft, confirms that the player owns the account, and assigns real UUIDs. No plugin is needed, and players cannot join with someone else's name. The downside is that Mojang's servers must be reachable.

Offline mode (online-mode=false) skips all of that. Anyone can connect with any username. That is fine for local development or for a backend behind a proxy that authenticates players, but not for a public server without a login plugin. Without verification, UUIDs are generated from the username alone, meaning anyone who types "Notch" gets Notch's UUID. Permissions, inventories, and OP status are all tied to that UUID.

Never run offline mode on a public server without an authentication plugin. Without one, any player can join as any username, including admin accounts.

Plugin-Based Authentication

For offline mode servers, authentication plugins add password-based login:

PluginApproachBest For
AuthMePassword registration/loginPublic offline servers
FastLoginHybrid online/offline detectionMixed premium + cracked players
nLoginSimple password authSmall servers

AuthMe Configuration

AuthMe is a common choice. Drop the JAR into your plugins/ folder and restart; it generates its config on first boot.

Core Settings

plugins/AuthMe/config.yml
settings:
  sessions:
    enabled: true          # Skip /login on rejoin from the same IP (off by default)
    timeout: 10            # Minutes; a new IP also ends the session
  restrictions:
    allowChat: false
    allowMovement: false
    allowCommands:
      - /login
      - /l
      - /register
      - /reg
    maxRegPerIp: 1         # Prevent spam accounts
    kickOnWrongPassword: true
    loginTimeout: 30       # Seconds before kicking players who don't log in
    registerTimeout: 30
  security:
    minPasswordLength: 5
    passwordMaxLength: 30
    passwordHash: BCRYPT2Y
    unsafePasswords:
      - '123456'
      - password
      - qwerty
      - help
  registration:
    enabled: true
    force: true
    messageInterval: 5
  preventOtherCase: true

Security:
  tempban:
    enableTempban: true    # Off by default
    maxLoginTries: 3       # Default: 10
    tempbanLength: 5       # Minutes; default: 480

AuthMe nests most options under settings. The Security section with a capital S is a separate top-level section.

Always use BCRYPT or BCRYPT2Y for password hashing. AuthMe salts SHA256 hashes, but SHA256 is fast, so an attacker with a database copy can try billions of guesses cheaply. BCRYPT is slow on purpose.

Database Backend

AuthMe uses SQLite by default. Switch to MySQL or MariaDB when several servers share the same accounts, such as backends behind a proxy, or when you want a separate database you can back up and query. Load test whichever backend you choose.

plugins/AuthMe/config.yml
DataSource:
  backend: 'MYSQL'
  mySQLHost: 'localhost'
  mySQLPort: '3306'
  mySQLDatabase: 'minecraft_authme'
  mySQLUsername: 'authme_user'
  mySQLPassword: 'secure_password_here'
  mySQLTablename: 'authme'
  mySQLPoolSize: 10
setup.sql
CREATE DATABASE minecraft_authme;
CREATE USER 'authme_user'@'localhost' IDENTIFIED BY 'secure_password_here';
GRANT ALL PRIVILEGES ON minecraft_authme.* TO 'authme_user'@'localhost';
FLUSH PRIVILEGES;

Testing Authentication

Run these checks on a test copy of your server, with a real client first.

Registration and Login

Connect with a fresh account. You'll land frozen in place: no movement, no chat, and no commands except /register and /login. That's the baseline. Run /register <password> <password>, and now you can move and interact normally. Disconnect, reconnect, and you're frozen again until you /login.

If sessions are enabled, reconnecting within the timeout window (default 10 minutes) auto-logs you in. Wait longer than that, and it'll ask for your password again.

Password Validation

Try the obvious bad passwords first. 123456, password, qwerty, and anything else on your unsafePasswords list gets rejected. Same for using your username as your password; AuthMe blocks that too. Anything shorter than minPasswordLength also fails.

Then test the change flow: register, run /changepassword oldpass newpass, disconnect, reconnect, and confirm the old password no longer works. Only the new one gets you in.

Brute Force Protection

With kickOnWrongPassword: true, each wrong password kicks you. With enableTempban: true and maxLoginTries: 3, the third failure from the same IP also bans that IP for tempbanLength minutes. Try connecting again during that window. The server should reject you before you see the login prompt.

Restriction Enforcement

Before logging in, check that all of these are blocked:

  • Movement (if allowMovement: false)
  • Chat messages (if allowChat: false)
  • Commands other than those in allowCommands

Also test the kick timeout: join, sit there doing nothing, and after the configured seconds the server boots you. If it doesn't, check settings.restrictions.loginTimeout and registerTimeout.

Database Persistence

Register an account, stop the server, restart it, and log in. The account persists across restarts. Verify the entry in your database:

verify.sql
-- AuthMe stores the lowercase name in username and the original case in realname
SELECT realname, ip, regdate FROM authme WHERE username = 'testplayer';

If the row's missing, your database backend isn't configured correctly. Check that AuthMe writes to MySQL and not falling back to SQLite.

Case-Sensitivity and Impersonation

If a player registers as "Notch", can someone else join as "notch"? AuthMe enables settings.preventOtherCase by default, so "notch" gets rejected when "Notch" is already registered. Confirm that nobody turned it off. Without it, different capitalizations act as separate accounts, which leaves impersonation wide open.

Hybrid Authentication with FastLogin

FastLogin sits in front of AuthMe and automatically detects premium accounts. Premium players skip the password flow entirely; cracked players fall through to AuthMe's /register and /login.

Test three scenarios:

  1. Premium account: auto-logs in with no password prompt
  2. Cracked account: goes through the normal AuthMe registration and login
  3. Cracked client using a premium username: gets rejected to prevent impersonation

Recent AuthMe releases also have a built-in premium mode (settings.enablePremium). Players opt in with /premium. Test the same three scenarios if you use it instead of FastLogin.

Security Testing

SQL Injection

On your own test server, try registering with payloads like /register ' OR '1'='1 password. AuthMe escapes these. If any succeed, you're running a dangerously outdated version. Update immediately.

Account Enumeration

AuthMe tells every joining player whether to /register or /login, so anyone can find out whether a name is registered. That is expected for password-based login. Don't treat usernames as secret. Rely on strong passwords, maxRegPerIp, and the tempban settings instead.

Session Security

AuthMe sessions remember the player's name and IP. A session ends when the timeout runs out or the IP changes. Log in, disconnect, and rejoin from a different address within the timeout. The server should ask for the password again. If it doesn't, someone who joins with that name could skip the login.

Load Testing with Bots

Manual testing covers correctness, but concurrency bugs and performance problems won't show up without real load.

What to Test

Mass registration: Connect 50 bots at once, each registering a unique account. Every one of them needs to succeed, with no race conditions and no duplicate key errors in the database. With maxRegPerIp: 1, bots from one machine fail after the first registration, so raise the limit on the test server or give each bot its own proxy. Restore the setting afterwards.

Login throughput: Disconnect all 50, then reconnect them simultaneously. Each runs /login. Watch for timeouts, failed logins, or "too many connections" errors from your database.

Session timeout accuracy: Log in a bot, disconnect, reconnect within the session window, and confirm it auto-logs in. Reconnect after the window expires. This time it asks for a password.

What to Monitor

terminal
# Auth events in real time
tail -f logs/latest.log | grep -i "authme\|login\|register"

# Database connection count (MySQL)
mysql -e "SHOW PROCESSLIST;"

# Server TPS under load (run in the server console)
spark tps

SoulFire can run these bot tests. Its Auto login and register plugin sends /register and /login for each bot. See the auto-register guide for setup. If the bots connect from one IP address and joins get rejected, see Connection throttled before you blame AuthMe.

If 100 bots can register and log in without failed logins or a TPS drop, your setup holds. If you see timeouts or "too many connections" errors, check the database connection pool and the database server's limits.

Things People Get Wrong

Running offline mode "just for now." Server scanners find open offline-mode servers quickly. Use online mode if you can. It is simpler and more secure, and you do not need an auth plugin. If you genuinely need offline mode (proxy setups, cracked player support), lock it down with AuthMe before you open the port.

Using SHA256 for password hashing. SHA256 is fast, which makes offline guessing cheap for anyone with a copy of the database. It is also AuthMe's default, so change passwordHash before the first player registers. Use legacyHashes to migrate existing accounts.

Leaving tempbans off. Security.tempban.enableTempban is false by default, so an attacker can keep guessing passwords from the same IP. Turn it on and set maxLoginTries to a small number.

No registration cap per IP. Without maxRegPerIp, a single person can create hundreds of accounts. Set it to 1 or 2. If someone legitimately needs more, you can whitelist them.

Skipping load testing. A login flow that works for 5 players can still time out when 50 join after a restart. Race conditions and connection pool limits only show up under load, so test with bots before you go live.

Next steps

  1. Switch passwordHash to BCRYPT and turn on tempbans before the first player registers.
  2. Run the manual checks above with a real client.
  3. Set up auto-register in SoulFire and run the mass registration and login tests.
  4. Test the join floods that often come with brute-force attempts with the anti-bot testing guide.

Related articles