HomeJavaModsDirectAuth
DirectAuth
ModsJava

DirectAuth

by marcp_dev · on CurseForge

A server-side-only authentication system with Online auto-login and zero configuration required. Protect your offline server with secure hashing and…

⬇ Download on CurseForge

The author built this one for Minecraft 1.21.1 on NeoForge. On other versions it may install and then do nothing.

DirectAuth

Build Status

DirectAuth is a server-side authentication mod for Minecraft NeoForge 1.21.1. It provides a secure login system for offline-mode servers, with optional auto-login for players who own a legitimate Minecraft account.

It is strictly server-side: clients do not need to install this mod to join. Players can connect with any vanilla client.

All database operations run asynchronously, so the main server thread never freezes during logins.

Key Features

Commands

Player commands

Command Usage Description
/register /register <password> Creates a new account. Required on first connection.
/login /login <password> Authenticates your session.
/logout /logout Logs you out (disconnects you from the server).
/changepassword /changepassword <oldPassword> <newPassword> Changes your password. Requires being logged in.
/unregister /unregister <password> Permanently deletes your own account (confirms with your password).
/online /online <password> Verifies your account against Mojang's servers to enable auto-login. Migrates your data to a new UUID — see the warning below.
/directauth confirm /directauth confirm Confirms a pending action when the mod requests it.

Admin commands (require OP level 4)

Command Usage Description
/directauth online /directauth online <user> <true|false> Manually toggles a player's online-mode status.
/directauth resetpass /directauth resetpass <user> <newPassword> Resets a player's password.
/directauth unregister /directauth unregister <user> Force-deletes a player's account (and kicks them if online).
/directauth reload /directauth reload Reloads the config and language files from disk at runtime — no server restart needed.
/directauth resetlang /directauth resetlang Deletes the language files so they regenerate from the mod's built-in defaults (discards manual edits).

⚠️ Important: Online Mode Migration

When a player runs /online, their UUID changes from the offline UUID to their real Mojang UUID, and DirectAuth migrates their data to the new UUID.

By default the mod already migrates vanilla data (inventory, ender chest, advancements, statistics) and a few common mods (graves/deaths, FTB Quests, SkinRestorer).

If your server uses other mods that store per-player data (e.g. Curios, Astral Sorcery, FTB Teams), the server administrator must add those folder names to the migration config before players run /online. Otherwise that mod-specific progress may be lost.

Always back up your world before migrating on a heavily modded server.

Installation

  1. Download the .jar file.
  2. Place it in the mods folder of your NeoForge 1.21.1 server.
  3. Restart the server.

On first launch the following files are generated:

Configuration

Edit world/serverconfig/DirectAuth-config.json to customize:

  "migrationMap": {
    "playerdata": "RENAME",
    "stats": "RENAME",
    "advancements": "RENAME",
    "deaths": "DIRECTORY",
    "ftbquests": "TEXT_REPLACE",
    "skinrestorer": "RENAME"
  }

Message strings can be edited in the DirectAuth-lang-*.json files.

Troubleshooting (FAQ)

Q: I keep getting teleported back when I move / I can't eat or regenerate health. A: You aren't authenticated yet. Use /register <password> (first time) or /login <password>.

Q: I lost my items from [some mod] after using /online. A: The server administrator likely hadn't added that mod's data folder to migrationMap. Contact your admin.

Technical Details

Compatibility

💖 Support the Project

DirectAuth is open-source and free to use. If you appreciate the work that goes into building and maintaining it, please consider supporting me!

Sponsor me on GitHub

Source Code & Issues: GitHub Repository · Report Issues

License

This project is licensed under the MIT License.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more