From 26d041ec2105e8ec4df77b60d72f7c6e9af88f4e Mon Sep 17 00:00:00 2001 From: Neptune Date: Fri, 8 Mar 2024 16:29:33 -0500 Subject: [PATCH] UltimMC: Use our MSA client ID --- CMakeLists.txt | 11 +++++++++++ buildconfig/BuildConfig.cpp.in | 1 + buildconfig/BuildConfig.h | 5 +++++ secrets/Secrets.cpp | 3 ++- 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ddc0956e..e9ac52ba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -111,6 +111,17 @@ set(Launcher_SUBREDDIT_URL "" CACHE STRING "URL for the subreddit.") # Use the secrets library or a public stub? option(Launcher_EMBED_SECRETS "Determines whether to embed secrets. Secrets are separate and non-public." OFF) +# API Keys +# NOTE: These API keys are here for convenience. If you rebrand this software or intend to break the terms of service +# of these platforms, please change these API keys beforehand. +# Be aware that if you were to use these API keys for malicious purposes they might get revoked, which might cause +# breakage to thousands of users. +# If you don't plan to use these features of this software, you can just remove these values. + +# By using this key in your builds you accept the terms of use laid down in +# https://docs.microsoft.com/en-us/legal/microsoft-identity-platform/terms-of-use +set(Launcher_MSA_CLIENT_ID "f4404707-7bbe-4e40-80ba-85fb2bb825a1" CACHE STRING "Client ID you can get from Microsoft Identity Platform when you register an application") + #### Check the current Git commit and branch include(GetGitRevisionDescription) get_git_head_revision(Launcher_GIT_REFSPEC Launcher_GIT_COMMIT) diff --git a/buildconfig/BuildConfig.cpp.in b/buildconfig/BuildConfig.cpp.in index 8c04dd4d..6fa4979b 100644 --- a/buildconfig/BuildConfig.cpp.in +++ b/buildconfig/BuildConfig.cpp.in @@ -45,6 +45,7 @@ Config::Config() NEWS_RSS_URL = "@Launcher_NEWS_RSS_URL@"; PASTE_EE_KEY = "@Launcher_PASTE_EE_API_KEY@"; IMGUR_CLIENT_ID = "@Launcher_IMGUR_CLIENT_ID@"; + MSA_CLIENT_ID = "@Launcher_MSA_CLIENT_ID@"; META_URL = "@Launcher_META_URL@"; BUG_TRACKER_URL = "@Launcher_BUG_TRACKER_URL@"; diff --git a/buildconfig/BuildConfig.h b/buildconfig/BuildConfig.h index 7ab5b100..589aafe7 100644 --- a/buildconfig/BuildConfig.h +++ b/buildconfig/BuildConfig.h @@ -80,6 +80,11 @@ public: */ QString IMGUR_CLIENT_ID; + /** + * Client ID you can get from Microsoft Identity Platform when you register an application + */ + QString MSA_CLIENT_ID; + /** * Metadata repository URL prefix */ diff --git a/secrets/Secrets.cpp b/secrets/Secrets.cpp index 88995635..4c2317da 100644 --- a/secrets/Secrets.cpp +++ b/secrets/Secrets.cpp @@ -1,4 +1,5 @@ #include "Secrets.h" +#include "../buildconfig/BuildConfig.h" #include #include @@ -28,7 +29,7 @@ namespace { * If you intend to base your own launcher on this code, take care and customize this to obfuscate the client ID, so it cannot be trivially found by casual attackers. */ -QString MSAClientID = ""; +QString MSAClientID = BuildConfig.MSA_CLIENT_ID; } namespace Secrets {