Conversation
…s quite odd this wasn't the case.
…ests. (serverside for right now.)
… text in the buffer before switching to asterisks when sent to exchange for token. (elyby)
…] and related classes.
…move' and handle profile removal
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as spam.
This comment was marked as spam.
|
Please refactor AuthModule, the auth implementations should not be in one large monolithic file. Separate them out. |
|
i dont think we should do this genuinely |
|
this also just gives microslop the opportunity to suspend anyone who uses the fork in the first place |
This comment was marked as off-topic.
This comment was marked as off-topic.
|
Please keep conversation in this PR related to the contents of the PR and concerns about things being introduced in this PR. |
|
From defnotsomeguy2 on Discord
|
I have a question about this, would Microsoft actually know you're using the leaked LCE source code for this? I've seen tons of other software such as Prism Launcher allow you to login to you Minecraft account and there's been no issues that I've heard of, the login application doesn't need to specify that it's for logging into this and could be something simple like, "ConsoleLogin". Overall I don't think the login would need to send info to Microsoft telling them what you're logging into, correct me if I'm wrong. |
No. It just says "Minecraft Launcher." No more details are provided. |
Description
adds a full authentication system to minecraftconsoles. msft oauth device code flow, yggdrasil-compatible auth (ely.by and any third-party provider via ]yggdrasil.json]), keypair-offline, and plain offline mode. includes server-side enforced auth handshake with an 11-stage protocol, a profile manager with persistent storage, UUID identity system, XUID-to-UUID migration, and configurable [auth-mode] for dedicated servers. also adds libcurl as a dependency for HTTPS, moves nlohmann/json into ]include/Common/vendor], and introduces ]yggdrasil.json] for pluggable third-party auth providers. (for now we are gonna keep the old xuid data, but push it out with a future patch.)
Changes
see new behavior
Previous Behavior
the original codebase was built for consoles where platform-level auth (xbl, psn, etc) handled identity. as we port it to windows, none of this exists, so we are faking this identity. as such, there is no HTTP client to talk to auth servers, no handshake protocol to negotiate authentication schemes, and no UUID system to give players a stable cross-platform identity. the [PreLoginPacket] name field could also overwrite an already-authenticated username which was a pretty obvious security hole once real auth was in place. big no no!!! (also msft store button was going unused.)
Root Cause
the original codebase was built for consoles where platform-level auth (Xbox Live, PSN) handled identity. when the project got ported to Windows none of that infrastructure existed, so identity was basically faked. there was no HTTP client to talk to auth servers, no handshake protocol to negotiate authentication schemes, and no UUID system to give players a stable cross-platform identity. the [PreLoginPacket] name field could also overwrite an already-authenticated username which was a pretty obvious security hole once real auth was in place.
New Behavior
players now authenticate through one of four methods. msft (oauth device code flow that opens a browser and polls for completion), yggdrasil (username/password exchange against any yggdrasil-compatible provider — ely.by ships in [yggdrasil.json], mojang is hardcoded as fallback), keypair-offline (local asymmetric keypair auth supporting rsa2048 and ed25519), or offline (trusts users are who they say they are). the server declares which auth scheme it requires via a new [auth-mode[ property ([session] or [offline]), and a full 11-stage handshake protocol ([ANNOUNCE_VERSION] through [AUTH_SUCCESS]/[AUTH_FAILURE]) negotiates and verifies identity before the player ever gets past the login screen.
(funnily enough, msft sees us as minecraft for nintendo switch when autodetected. not bedrock, the original.)This is now fixed; We are now recognized as Java, as we should have been.
continuing:
profiles now exist in a binary "auth_profiles.dat" file with token refresh support for both Microsoft and Yggdrasil providers. profiles now track a [variation] field so the system knows which provider issued them. the in-game UI lets you add, remove, cycle through, and apply profiles. players get a [GameUUID] (v5 UUID derived from their identity under the [MinecraftConsoles] namespace) that gets serialized in [LoginPacket] and [AddPlayerPacket]. existing ban/whitelist entries with XUIDs automatically get backfilled with UUIDs on load, and player save files get migrated from XUID-named ".dat" files to UUID-named ones.
the auth module hierarchy was consolidated in v3: [OfflineAuthModule] and [KeypairOfflineAuthModule] got inlined into [AuthModule.h] (separate .cpp/.h files deleted), [SessionAuthModule] was generalized to handle any yggdrasil provider via configurable URLs loaded from [yggdrasil.json], and the old hardcoded ely.by-specific [startElyBy()] flow was replaced with a generic [startYggdrasil()] that takes provider name and auth URL. [ELYBY] profile type became [YGGDRASIL].
if auth fails the client gets a proper [eDisconnect_AuthFailed] disconnect reason with a localized error message instead of just getting silently dropped.
Fix Implementation
the core of this is a new [HttpClient], [AuthModule] hierarchy (session/keypair-offline/offline — all in [AuthModule.h] now), [AuthPackets] (11-stage enum with key-value fields), and a [HandshakeManager] state machine that drives the whole protocol from both sides. [SessionAuthModule] reads provider configs from [yggdrasil.json] at runtime and does full server-side [hasJoined] verification over HTTPS.
[AuthScreen] handles the threaded OAuth/yggdrasil auth flows and profile persistence in a binary [auth_profiles.dat]. [UUID.h/cpp] implements [GameUUID] with a custom SHA-1 for v5 generation, deterministic XUID conversion, and a [MCCONSOLES_NAMESPACE_UUID] constant. on the server side, [PendingConnection] now runs [initAuth()] based on [auth-mode] from [ServerProperties], guards [PreLoginPacket] name overwrites, and disconnects with [eDisconnect_AuthFailed] on failure. [ClientConnection] mirrors this on the client side and syncs the authenticated name back into the platform globals. [DirectoryLevelStorage] handles XUID-to-UUID save file migration, and [BanManager]/[WhitelistManager] backfill UUIDs on load. [UIScene_MainMenu] got the full profile management UI with next/use/add/remove.
AI Use Disclosure
no ai was used to make this
Related Issues