Skip to content

feat(premium): allow changing the default auth servers#3082

Open
colbster937 wants to merge 4 commits into
AuthMe:masterfrom
colbster937:master
Open

feat(premium): allow changing the default auth servers#3082
colbster937 wants to merge 4 commits into
AuthMe:masterfrom
colbster937:master

Conversation

@colbster937
Copy link
Copy Markdown

@colbster937 colbster937 commented May 27, 2026

this would allow you to use a custom authentication server (such as https://github.com/unmojang/drasl) to authenticate premium players.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds configurability to AuthMe’s premium verification by moving premium settings under a dedicated settings.premium.* section and introducing configurable endpoints for profile and session verification, enabling use of alternative authentication backends (e.g., drasl).

Changes:

  • Migrate settings.enablePremium to the new settings.premium.enabled key.
  • Add settings.premium.accountServer and settings.premium.sessionServer configuration properties.
  • Update MojangApiService to read premium verification endpoints from settings instead of hardcoded Mojang URLs.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
authme-core/src/main/java/fr/xephi/authme/settings/SettingsMigrationService.java Adds migration from legacy premium toggle key to the new settings.premium.enabled path.
authme-core/src/main/java/fr/xephi/authme/settings/properties/PremiumSettings.java Moves premium enabled setting and introduces configurable account/session server properties.
authme-core/src/main/java/fr/xephi/authme/service/MojangApiService.java Uses configured URLs for profile lookup and session verification instead of constants.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +28 to +30
@Comment("Session server used for premium verification.")
public static final Property<String> SESSION_SERVER =
newProperty("settings.premium.sessionServer", "https://sessionserver.mojang.com");
Comment on lines +76 to +78
String url = settings.getProperty(PremiumSettings.SESSION_SERVER)
+ "?username=" + URLEncoder.encode(username, "UTF-8")
+ "&serverId=" + URLEncoder.encode(serverHash, "UTF-8");

private final ConsoleLogger logger = ConsoleLoggerFactory.get(MojangApiService.class);

private Settings settings;
Comment on lines 46 to 48
try {
HttpURLConnection conn = openGet(PROFILE_URL + username);
HttpURLConnection conn = openGet(settings.getProperty(PremiumSettings.ACCOUNT_SERVER) + username);
int code = conn.getResponseCode();
Comment on lines +167 to +173
private static boolean migratePremiumSetting(PropertyReader reader, ConfigurationData configData) {
return moveProperty(
newProperty("settings.enablePremium", false),
PremiumSettings.ENABLE_PREMIUM,
reader,
configData
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants