Security

Password hashing, brute force protection, 2FA, captcha, and geolocation settings.

Password Hashing

mineLogin supports multiple password hashing algorithms. Configure the hashing method in the passwords-security section:

passwords-security:
  hash-type: BCRYPT
  salt-for-passwords: false
  delete-password-after-change-account-type: true
AlgorithmDescription
BCRYPTIndustry-standard, recommended for most setups
ARGON2Memory-hard algorithm, strongest option
SHA512Fast cryptographic hash
SHA256Fast cryptographic hash
MD5Legacy support only, not recommended
OptionTypeDefaultDescription
hash-typeEnumBCRYPTPassword hashing algorithm
salt-for-passwordsBooleanfalseAdd an additional salt to passwords
delete-password-after-change-account-typeBooleantrueRemove password when switching to premium

Password Restrictions

passwords-security:
  password-restrictions:
    minimum-password-length: 6
    maximum-password-length: 16
    regex: "^[a-zA-Z0-9!%&#@*]*"
OptionTypeDefaultDescription
minimum-password-lengthInteger6Minimum allowed password length
maximum-password-lengthInteger16Maximum allowed password length
regexString^[a-zA-Z0-9!%&#@*]*Regex pattern for allowed password characters

Blocked Passwords

Common passwords can be blocked in blocked-passwords.yml:

blocked-passwords:
  - "password"
  - "password123"
  - "123456"
  - "qwerty"

Brute Force Protection

mineLogin automatically protects against brute force attacks by limiting login and recovery attempts.

Attempt Limits

limits:
  login-attempts: 3
  recovery-code-attempts: 3
  accounts-per-address: 2
  accounts-per-address-check-type: ON_JOIN
OptionTypeDefaultDescription
login-attemptsInteger3Max login attempts before action is taken
recovery-code-attemptsInteger3Max recovery code attempts before action
accounts-per-addressInteger2Max accounts allowed per IP address
accounts-per-address-check-typeEnumON_JOINWhen to check IP limit (ON_JOIN or ON_REGISTER)

IP Banning

security:
  ban-ip-on-max-login-attempts: true
  ban-ip-on-max-recovery-attempts: true
  ip-ban-time: "30m"
OptionTypeDefaultDescription
ban-ip-on-max-login-attemptsBooleantrueBan IP after exceeding login attempts
ban-ip-on-max-recovery-attemptsBooleantrueBan IP after exceeding recovery attempts
ip-ban-timeDuration30mDuration of the IP ban

Tip: Use /ml unban <ip> to manually unban an IP address.


Two-Factor Authentication (2FA)

mineLogin supports TOTP-based two-factor authentication using apps like Google Authenticator or Authy.

Configuration

verification:
  enabled: false
  require-permission: false
  permission: ""
  create-verification-timeout: "1m"
  verification-confirm-timeout: "30s"
  session-active-time: "3d"
  auto-enable-session: false
OptionTypeDefaultDescription
enabledBooleanfalseEnable 2FA support
require-permissionBooleanfalseOnly allow players with a specific permission to use 2FA
permissionString""Permission node that forces 2FA setup
create-verification-timeoutDuration1mTime to complete 2FA setup
verification-confirm-timeoutDuration30sTime to enter a TOTP code during login
session-active-timeDuration3dDuration of trusted 2FA sessions
auto-enable-sessionBooleanfalseAuto-enable session after 2FA verification

How It Works

  1. Player runs /verification enable to start 2FA setup
  2. The plugin generates a TOTP secret and shows a setup key
  3. Player scans the key with an authenticator app
  4. Player confirms with /verification enable <code>
  5. The plugin generates 6 recovery codes as backup
  6. On future logins, the player must enter a TOTP code with /verification verify <code>

Recovery Codes

When 2FA is enabled, 6 alphanumeric recovery codes are generated. These can be used to disable 2FA if the authenticator app is lost.

2FA Sessions

Similar to login sessions, 2FA sessions allow skipping the TOTP code on trusted IP addresses. Toggle with /verification session.


Captcha

mineLogin supports captcha verification during registration to prevent automated account creation.

other-settings:
  captcha: true
  captcha-type: CHAT
TypeDescription
CHATA text-based captcha code displayed in chat. Player must type it as part of the /register command
MAPAn interactive map-based captcha rendered on the backend server (requires the bridge plugin)

Geolocation Blocking

Restrict access based on player IP geolocation.

geo-location:
  enabled: false
  available-countries:
    - "PL"
    - "FR"
    - "US"
    - "GB"
OptionTypeDefaultDescription
enabledBooleanfalseEnable geolocation restrictions
available-countriesList["PL", "FR", "EN", "US", "GB"]Allowed country ISO codes

Administrators can manage the geolocation whitelist per IP:

  • /ml geolocation check <ip> — check if an IP is whitelisted
  • /ml geolocation add <ip> — add an IP to the whitelist
  • /ml geolocation remove <ip> — remove an IP from the whitelist

Session System

The session system allows players to skip password entry on trusted IP addresses.

other-settings:
  session-active-time: "3d"
  auto-enable-session: false
OptionTypeDefaultDescription
session-active-timeDuration3dHow long a session remains valid
auto-enable-sessionBooleanfalseAutomatically enable sessions on login

How Sessions Work

  1. Player logs in normally with /login
  2. Player runs /session to enable trusted session
  3. On next login from the same IP within the session duration, the password is skipped
  4. If the IP changes, the session is invalidated
  5. Sessions persist across server restarts

Nickname Restrictions

other-settings:
  nickname-allowed-regex: "[a-zA-Z0-9_]+"

Players with nicknames that do not match the configured regex pattern will be denied access.


Login Timeout

other-settings:
  login-timeout: "30s"

Players who do not authenticate within the configured timeout are automatically kicked from the server.