Skip to content

Commit

Permalink
UltimMC: Use our MSA client ID
Browse files Browse the repository at this point in the history
  • Loading branch information
Neptune650 committed Mar 8, 2024
1 parent 334812f commit 26d041e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions buildconfig/BuildConfig.cpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -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@";
Expand Down
5 changes: 5 additions & 0 deletions buildconfig/BuildConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ class Config
*/
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
*/
Expand Down
3 changes: 2 additions & 1 deletion secrets/Secrets.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "Secrets.h"
#include "../buildconfig/BuildConfig.h"

#include <array>
#include <cstdio>
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 26d041e

Please sign in to comment.