From 9eba5525f4384da68126645629b281473027b87e Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Mon, 11 Jan 2021 11:09:12 -0500 Subject: [PATCH] Add togglable password authentication option --- src/main/java/org/geysermc/connect/GeyserConnectConfig.java | 3 +++ .../java/org/geysermc/connect/proxy/GeyserProxyBootstrap.java | 1 + src/main/resources/config.yml | 3 +++ src/main/resources/proxy_config.yml | 2 +- 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/geysermc/connect/GeyserConnectConfig.java b/src/main/java/org/geysermc/connect/GeyserConnectConfig.java index 53bac24..b27a8b9 100644 --- a/src/main/java/org/geysermc/connect/GeyserConnectConfig.java +++ b/src/main/java/org/geysermc/connect/GeyserConnectConfig.java @@ -74,6 +74,9 @@ public class GeyserConnectConfig { private int port; + @JsonProperty("allow-password-authentication") + private boolean allowPasswordAuthentication = true; + @JsonProperty("debug-mode") private boolean debugMode; diff --git a/src/main/java/org/geysermc/connect/proxy/GeyserProxyBootstrap.java b/src/main/java/org/geysermc/connect/proxy/GeyserProxyBootstrap.java index 58cd569..ee6c968 100644 --- a/src/main/java/org/geysermc/connect/proxy/GeyserProxyBootstrap.java +++ b/src/main/java/org/geysermc/connect/proxy/GeyserProxyBootstrap.java @@ -71,6 +71,7 @@ public class GeyserProxyBootstrap implements GeyserBootstrap { text = text.replace("PORT", String.valueOf(multiConfig.getGeyser().getPort())); text = text.replaceAll("MOTD", multiConfig.getMotd()); text = text.replace("PLAYERS", String.valueOf(multiConfig.getMaxPlayers())); + text = text.replace("ALLOWPASSWORDAUTHENTICATION", String.valueOf(multiConfig.getGeyser().isAllowPasswordAuthentication())); ObjectMapper objectMapper = new ObjectMapper(new YAMLFactory()); geyserConfig = objectMapper.readValue(text, GeyserProxyConfiguration.class); diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 6cbeab0..851d34f 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -25,6 +25,9 @@ geyser: # The port that will listen for connections port: 19133 + # If password authentication should be allowed in online mode. + allow-password-authentication: true + # If debug messages should be sent through console, has to be enabled in both places to work debug-mode: false diff --git a/src/main/resources/proxy_config.yml b/src/main/resources/proxy_config.yml index 44fba2b..71c37f4 100644 --- a/src/main/resources/proxy_config.yml +++ b/src/main/resources/proxy_config.yml @@ -32,7 +32,7 @@ remote: port: 25565 # Authentication type. Can be offline, online, or floodgate (see https://github.com/GeyserMC/Geyser/wiki/Floodgate). auth-type: online - allow-password-authentication: false + allow-password-authentication: ALLOWPASSWORDAUTHENTICATION # Floodgate uses encryption to ensure use from authorised sources. # This should point to the public key generated by Floodgate (Bungee or CraftBukkit)