Download Simple Login — Minecraft Mods — MetaMods

Simple Login

Active

Downloads

14

Last update

2 years ago
Client
Fabric
Quilt
Forge
Neoforge
Utils

Simple Login

Simple Login is a Forge mod designed to protect servers running in offline mode.

Feature Overview

This mod performs functions similar to authorization plugins like AuthMe for Bukkit: it verifies the player's password when connecting to the server. However, there is an important difference - instead of entering the password via command, passwords are stored in a special file on the client side and automatically sent to the server when the player connects. This eliminates the need to manually enter the password each time. During the first launch, the client will prompt to set a password, so in most cases players won't need to perform additional actions.

Installation

For the mod to work, you need to place the simplelogin-xxx.jar file in the mods folder both on the server and the client.

Getting Started

If you're satisfied with the default settings, no additional configuration is required.

Player passwords don't need to be entered manually - the client generates a random UUID as a password and saves it in the .minecraft/.sl_password file, then sends it to the server when connecting. The server remembers the player's password during the first login and verifies its match during subsequent connections.

Frequently Asked Questions

How secure is my password?

The password is hashed using SHA256 on the client side and additionally hashed with BCrypt before being saved on the server. However, on the client side, the password is stored without encryption, so be careful and don't copy the .minecraft/.sl_password file when sharing the client with other users.

What to do when changing clients?

Create a backup of the minecraft/.sl_password file and copy it to the new client.

Data Storage Systems

Simple Login offers various ways to store user data on the server, each with its own advantages and disadvantages. The mod provides an abstract layer for implementing different storage systems called "storage providers".

Each provider has a unique resource identifier (for example, simplelogin:file).

The mod comes with two built-in providers: file and sqlite.

File Storage

Identifier: simplelogin:file

This is the simplest storage system implementation that saves all user data in JSON format at the path world/sl_entries.dat.

SQLite Storage

Identifier: simplelogin:sqlite

The SQLite provider can be more efficient than file storage but requires installing an SQLite JDBC connector of about 6 MB, which is not included with Simple Login. To use this provider, you need to install the JDBC connector yourself.

Custom Storage Systems

If you're familiar with Java and Forge mod development, creating your own provider shouldn't be difficult.

You need to implement the top.seraphjack.simplelogin.server.storage.StorageProvider interface and register your provider before the server starts via the call top.seraphjack.simplelogin.server.SLRegistries.STORAGE_PROVIDERS::register.

Simple Login Plugins

Simple Login plugins extend the functionality of handling player login, authorization, and logout events on the server.

Like storage systems, each plugin has a unique resource identifier.

Key Simple Login functions are also implemented as built-in plugins:

AutoSave

Identifier: simplelogin:autosave

This plugin automatically saves all data through the storage system every five minutes. Enabled by default.

ProtectCoord

Identifier: simplelogin:protect_coord

Teleports players to the spawn point before leaving the server and returns them back after successful authorization, preventing possible coordinate leaks during unauthorized login attempts. Disabled by default due to potential issues with large modpacks.

ResendRequest

Identifier: simplelogin:resend_request

Requests re-authorization from the client every five seconds if the previous login packet didn't reach the server for some reason. Enabled by default.

RestrictGameType

Identifier: simplelogin:restrict_game_type

Changes the player's game mode to spectator when leaving or joining the server, returning the original game mode (saved in the storage system) after successful authorization. Enabled by default.

RestrictMovement

Identifier: simplelogin:restrict_movement

Blocks player movement until authorization is completed. Enabled by default.

Timeout

Identifier: simplelogin:timeout

Disconnects players who haven't completed authentication within a specified time (default 600 seconds, configurable in Simple Login configuration at //serverconfig/simplelogin-server.toml). Initially, the timeout was 60 seconds but was increased to 600 due to issues with large modpacks where synchronization during login could take more than a minute. Enabled by default.

Commands

All commands support autocompletion.

  • /simplelogin unregister <PlayerName> - removes player registration
  • /simplelogin save - saves all player entries
  • /simplelogin setDefaultGameType <PlayerName> <GameType> - configures post-authorization game mode for the player
  • /simplelogin about - shows version information
  • /simplelogin plugin available - displays list of available plugins
  • /simplelogin plugin loaded - shows list of loaded plugins
  • /simplelogin plugin load <ResourceLocation> - loads the specified plugin
  • /simplelogin plugin unload <ResourceLocation> - unloads the specified plugin
  • /sl_change_password <NewPassword> - changes password to new one (implemented on client side for security reasons)

Configuration

Server Configuration

  • secs: Integer

    • Authentication waiting time for players. If authorization doesn't occur within this time, the player will be disconnected.
    • Default: 600 seconds
    • Originally 60 seconds but increased to 10 minutes due to timeout issues with large modpacks
  • plugins: String Array

    • Plugins to load by default
  • commandNames: String Array

    • Commands allowed to be executed by a player before authorization
    • Need to specify the full command without the / symbol, for example: give @p minecraft:apple 16
  • storageProvider: String

    • Storage system to use
  • defaultGameType: Integer

    • Default game mode for new users
    • 0, 1, 2, 3 correspond to survival, creative, adventure, and spectator
Project members
seraph_jack

seraph_jack

Created: 9 Sep 2023

ID: 18709