config update
This commit is contained in:
parent
63d68114e7
commit
3bb679c28f
88
README.md
Normal file
88
README.md
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
# 🔐 XCraftAuth – Yggdrasil Authentication
|
||||||
|
|
||||||
|
A powerful **custom session server** plugin for Spigot-based servers, allowing full **Yggdrasil authentication** support across **1.8-1.16.5 Minecraft versions**! This plugin enables true **online mode authentication** with a self-hosted session server, providing flexibility for your Minecraft network.
|
||||||
|
|
||||||
|
**THIS PLUGIN ONLY WORKS ON SERVERS THAT RUN UNDER JAVA 8, NEWER VERSIONS OF JAVA WILL BREAK THIS PLUGIN**
|
||||||
|
|
||||||
|
**🌟 No need for AuthMe!** This plugin completely replaces AuthMe by handling authentication through a custom session server.
|
||||||
|
|
||||||
|
**🎨 Built-in skin & cape support!** Players can edit their skins and capes without needing Mojang's servers.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ✨ Features
|
||||||
|
|
||||||
|
✅ **Supports all modern Minecraft versions** – From 1.8 to the 1.16.5 release.
|
||||||
|
✅ **Compatible with all Bukkit/Spigot-based server software**, including:
|
||||||
|
- **CraftBukkit**
|
||||||
|
- **Spigot**
|
||||||
|
- **Paper**
|
||||||
|
- **CatServer** (Forge + Bukkit)
|
||||||
|
- **Magma** (Forge + Bukkit)
|
||||||
|
- **Mohist** (Forge + Bukkit)
|
||||||
|
|
||||||
|
✅ **Full Yggdrasil authentication** – Works with your custom authentication system.
|
||||||
|
✅ **Self-hosted session server** – No need for Mojang's authentication services.
|
||||||
|
✅ **Seamless integration** – Works as a drop-in replacement for online mode.
|
||||||
|
✅ **Replaces AuthMe** – No need for password-based authentication plugins.
|
||||||
|
✅ **Custom skin & cape support** – Change your skin and cape at any time!
|
||||||
|
✅ **Customizable** – Modify authentication endpoints to fit your needs.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📥 Installation
|
||||||
|
|
||||||
|
1. **Download the latest release** from Jenkins.
|
||||||
|
2. **Place the JAR file** in your `plugins` folder.
|
||||||
|
3. **Restart your server** to generate the configuration file.
|
||||||
|
4. **Configure your public domain and public port (for reverse proxy setup)** in the config file (`config.yml`).
|
||||||
|
5. **Restart your server** to apply changes.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🎨 Skin & Cape Editing
|
||||||
|
|
||||||
|
If you use this plugin, **players can change their skins and capes** freely! The skin system is independent of Mojang’s servers and fully integrated with the custom session server. The only thing you need is XCraft launcher
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ⚙️ Configuration
|
||||||
|
|
||||||
|
Edit `plugins/XCraftAuth/config.yml`:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
public_domain: "localhost" # Should be the same as the domain of your minecraft server
|
||||||
|
public_port: 8999 # Reverse proxy port (leave same if there's no reverse proxy)
|
||||||
|
internal_port: 8999 # Session server port
|
||||||
|
use_https: false # Set true if you're using reverse proxy setup
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🚀 Usage
|
||||||
|
|
||||||
|
Once installed and configured, your server will authenticate players using your **custom session server**, just like Mojang’s online mode. Players must authenticate via your system before joining.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ❓ FAQ
|
||||||
|
|
||||||
|
**Q: Can this replace Mojang's authentication system?**
|
||||||
|
A: Yes! This plugin enables **custom online mode authentication**, independent of Mojang’s servers.
|
||||||
|
|
||||||
|
**Q: Does this work with cracked clients?**
|
||||||
|
A: Yes, but **only** when using the **XCraft launcher**, which integrates with the custom session system.
|
||||||
|
|
||||||
|
**Q: Can players edit their skins and capes?**
|
||||||
|
A: Yes! With this plugin, players can change their skins and capes without Mojang’s servers.
|
||||||
|
|
||||||
|
**Q: Can this replace AuthMe?**
|
||||||
|
A: Yes! Since this plugin uses a session server for authentication, you **do not need AuthMe**.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📜 License
|
||||||
|
|
||||||
|
This project is **open-source** and licensed under the **MIT License**.
|
||||||
|
|
||||||
|
|
@ -22,8 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
import java.util.concurrent.ConcurrentMap;
|
import java.util.concurrent.ConcurrentMap;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import static com.alterdekim.xcraft.auth.XCraft.PUBLIC_DOMAIN;
|
import static com.alterdekim.xcraft.auth.XCraft.*;
|
||||||
import static com.alterdekim.xcraft.auth.XCraft.SERVER_PORT;
|
|
||||||
|
|
||||||
public class SaltNic extends NanoHTTPD {
|
public class SaltNic extends NanoHTTPD {
|
||||||
|
|
||||||
@ -38,12 +37,12 @@ public class SaltNic extends NanoHTTPD {
|
|||||||
private static final int MAX_FILE_SIZE = 1024 * 1024;
|
private static final int MAX_FILE_SIZE = 1024 * 1024;
|
||||||
|
|
||||||
public SaltNic(Logger logger) throws IOException {
|
public SaltNic(Logger logger) throws IOException {
|
||||||
super(SERVER_PORT);
|
super(INTERNAL_PORT);
|
||||||
this.logger = logger;
|
this.logger = logger;
|
||||||
this.storage = new UserStorage();
|
this.storage = new UserStorage();
|
||||||
this.sessions = new ConcurrentHashMap<>();
|
this.sessions = new ConcurrentHashMap<>();
|
||||||
start(NanoHTTPD.SOCKET_READ_TIMEOUT, false);
|
start(NanoHTTPD.SOCKET_READ_TIMEOUT, false);
|
||||||
logger.info("SaltNic session server started on http://localhost:"+SERVER_PORT);
|
logger.info("SaltNic session server started on http://localhost:"+INTERNAL_PORT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -223,7 +222,7 @@ public class SaltNic extends NanoHTTPD {
|
|||||||
Map<MinecraftProfileTexture.Type, MinecraftProfileTexture> textures = new HashMap<>();
|
Map<MinecraftProfileTexture.Type, MinecraftProfileTexture> textures = new HashMap<>();
|
||||||
|
|
||||||
if( new File(SKIN_DIRECTORY, uuid + ".png").exists() ) {
|
if( new File(SKIN_DIRECTORY, uuid + ".png").exists() ) {
|
||||||
MinecraftProfileTexture texture = new MinecraftProfileTexture("http://"+PUBLIC_DOMAIN+":"+SERVER_PORT+"/api/skin/s" + uuid, new HashMap<>());
|
MinecraftProfileTexture texture = new MinecraftProfileTexture("http" + (USE_HTTPS ? "s" : "") + "://"+PUBLIC_DOMAIN+":"+SERVER_PORT+"/api/skin/s" + uuid, new HashMap<>());
|
||||||
if( storage.getSkinModel(uuid) == User.SkinModel.Alex ) {
|
if( storage.getSkinModel(uuid) == User.SkinModel.Alex ) {
|
||||||
texture.getMetadata().put("model", "slim");
|
texture.getMetadata().put("model", "slim");
|
||||||
}
|
}
|
||||||
@ -231,7 +230,7 @@ public class SaltNic extends NanoHTTPD {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( new File(CAPE_DIRECTORY, uuid + ".png").exists() ) {
|
if( new File(CAPE_DIRECTORY, uuid + ".png").exists() ) {
|
||||||
textures.put(MinecraftProfileTexture.Type.CAPE, new MinecraftProfileTexture("http://"+PUBLIC_DOMAIN+":"+SERVER_PORT+"/api/cape/a" + uuid, new HashMap<>()));
|
textures.put(MinecraftProfileTexture.Type.CAPE, new MinecraftProfileTexture("http"+(USE_HTTPS ? "s" : "")+"://"+PUBLIC_DOMAIN+":"+SERVER_PORT+"/api/cape/a" + uuid, new HashMap<>()));
|
||||||
}
|
}
|
||||||
|
|
||||||
MinecraftTexturesPayload minecraftTexturesPayload = new MinecraftTexturesPayload(System.currentTimeMillis(), uuid, this.storage.getUsername(uuid), textures);
|
MinecraftTexturesPayload minecraftTexturesPayload = new MinecraftTexturesPayload(System.currentTimeMillis(), uuid, this.storage.getUsername(uuid), textures);
|
||||||
|
@ -13,6 +13,7 @@ public class XCraft extends JavaPlugin {
|
|||||||
private static SaltNic server = null;
|
private static SaltNic server = null;
|
||||||
|
|
||||||
public static int SERVER_PORT = 8999;
|
public static int SERVER_PORT = 8999;
|
||||||
|
public static int INTERNAL_PORT = 8999;
|
||||||
public static String PUBLIC_DOMAIN = "localhost";
|
public static String PUBLIC_DOMAIN = "localhost";
|
||||||
public static Boolean USE_HTTPS = false;
|
public static Boolean USE_HTTPS = false;
|
||||||
|
|
||||||
@ -23,6 +24,7 @@ public class XCraft extends JavaPlugin {
|
|||||||
try {
|
try {
|
||||||
getLogger().info("Starting SaltNic server...");
|
getLogger().info("Starting SaltNic server...");
|
||||||
SERVER_PORT = getConfig().getInt("public_port");
|
SERVER_PORT = getConfig().getInt("public_port");
|
||||||
|
INTERNAL_PORT = getConfig().getInt("internal_port");
|
||||||
PUBLIC_DOMAIN = getConfig().getString("public_domain");
|
PUBLIC_DOMAIN = getConfig().getString("public_domain");
|
||||||
USE_HTTPS = getConfig().getBoolean("use_https");
|
USE_HTTPS = getConfig().getBoolean("use_https");
|
||||||
server = new SaltNic(getLogger());
|
server = new SaltNic(getLogger());
|
||||||
@ -45,9 +47,9 @@ public class XCraft extends JavaPlugin {
|
|||||||
|
|
||||||
private void patchAuthLib() throws Exception {
|
private void patchAuthLib() throws Exception {
|
||||||
Class<?> clazz = Class.forName("com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService");
|
Class<?> clazz = Class.forName("com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService");
|
||||||
modifyFinalField(clazz, "BASE_URL", "http://localhost:"+SERVER_PORT+"/api/");
|
modifyFinalField(clazz, "BASE_URL", "http://localhost:"+INTERNAL_PORT+"/api/");
|
||||||
modifyFinalField(clazz, "JOIN_URL", new URL("http://localhost:"+SERVER_PORT+"/api/join"));
|
modifyFinalField(clazz, "JOIN_URL", new URL("http://localhost:"+INTERNAL_PORT+"/api/join"));
|
||||||
modifyFinalField(clazz, "CHECK_URL", new URL("http://localhost:"+SERVER_PORT+"/api/hasJoined"));
|
modifyFinalField(clazz, "CHECK_URL", new URL("http://localhost:"+INTERNAL_PORT+"/api/hasJoined"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void modifyFinalField(Class<?> clazz, String fieldName, Object newValue) throws Exception {
|
private void modifyFinalField(Class<?> clazz, String fieldName, Object newValue) throws Exception {
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
public_domain: "localhost"
|
public_domain: "localhost"
|
||||||
public_port: 8999
|
public_port: 8999
|
||||||
|
internal_port: 8999
|
||||||
use_https: false
|
use_https: false
|
Loading…
x
Reference in New Issue
Block a user