[PR #3630] [MERGED] Launcher: new Microsoft accounts can join online-mode servers #5107

Closed
opened 2026-11-03 05:10:17 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3630
Author: @ludovic111
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @ludovic111

Base: main ← Head: fix/launcher-new-account-join


📝 Commits (1)

  • 2fe5fa0 Launcher: new Microsoft accounts get a token that joins online-mode servers

📊 Changes

2 files changed (+89 additions, -12 deletions)

View changed files

📝 launcher/src/account.rs (+29 -11)
📝 launcher/src/account/tests.rs (+60 -1)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

New Microsoft accounts could sign in but not join online-mode servers. Their Minecraft token from authentication/login_with_xbox names no profile, so sessionserver.mojang.com/session/minecraft/join answers "Profile not found", although /minecraft/profile returns the profile with the same token. Older accounts' tokens name it and work.

Credit to @martipops, who found and diagnosed this.

The fix:

  • The token now comes from POST https://api.minecraftservices.com/launcher/login, with body {"xtoken": "XBL3.0 x=<uhs>;<XSTS token>", "platform": "PC_LAUNCHER"}, through the same XSTS relying party as before.
  • The answer's access_token and expires_in are read.
  • If launcher/login fails (any status, no token, or no connection), the launcher falls back to login_with_xbox as before, so an account that signs in today still does.
  • The owner gate is unchanged: the entitlements check and the profile check use whichever token was obtained.

Tests, against the local mock:

  • the_whole_chain now goes through launcher/login and checks its request body.
  • login_with_xbox_signs_in_when_launcher_login_refuses covers 401, 404 and 503, each followed by the same entitlement and profile checks, and an account that doesn't own the game is still refused.
  • tests/owner_gate.rs passes.

Not tested with a real new account here. @martipops, could you confirm with yours?

Sources

  • The endpoint and its request body, from the bug report above (an interface fact, no launcher code read). The URL also appears in public issue threads: MultiMC #5307, Prism Launcher #5627.
  • A black-box call with a dummy token answers 401 {"path": "/launcher/login", "error": "UNAUTHORIZED"}, the same error shape as login_with_xbox.
  • login_with_xbox and the rest of the chain: minecraft.wiki: Microsoft authentication.

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at 1816cf0b5, 3 min 11 s)

Check Result
Scope ✅ 2 files, +89 −12
Cargo.lock ✅ unchanged
Public tree ✅ (1 s)
Python tests ✅ 408 passed (2 min 29 s)
rustfmt ➖ no Rust change
clippy ➖ no Rust change
tests ➖ no crate touched
doc tests ➖ no crate touched
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅ (7 s)
launcher clippy ✅ (30 s)
launcher tests ✅ 262 passed (4 s)
Parity ➖ 1 affected, to run in CI (--quick): lan_integration
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/3630 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/launcher-new-account-join` --- ### 📝 Commits (1) - [`2fe5fa0`](https://github.com/horizon-rust/horizon/commit/2fe5fa0939a5d72f694a55915073c58eae100b75) Launcher: new Microsoft accounts get a token that joins online-mode servers ### 📊 Changes **2 files changed** (+89 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `launcher/src/account.rs` (+29 -11) 📝 `launcher/src/account/tests.rs` (+60 -1) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. New Microsoft accounts could sign in but not join online-mode servers. Their Minecraft token from `authentication/login_with_xbox` names no profile, so `sessionserver.mojang.com/session/minecraft/join` answers "Profile not found", although `/minecraft/profile` returns the profile with the same token. Older accounts' tokens name it and work. Credit to @martipops, who found and diagnosed this. The fix: - The token now comes from `POST https://api.minecraftservices.com/launcher/login`, with body `{"xtoken": "XBL3.0 x=<uhs>;<XSTS token>", "platform": "PC_LAUNCHER"}`, through the same XSTS relying party as before. - The answer's `access_token` and `expires_in` are read. - If `launcher/login` fails (any status, no token, or no connection), the launcher falls back to `login_with_xbox` as before, so an account that signs in today still does. - The owner gate is unchanged: the entitlements check and the profile check use whichever token was obtained. Tests, against the local mock: - `the_whole_chain` now goes through `launcher/login` and checks its request body. - `login_with_xbox_signs_in_when_launcher_login_refuses` covers 401, 404 and 503, each followed by the same entitlement and profile checks, and an account that doesn't own the game is still refused. - `tests/owner_gate.rs` passes. Not tested with a real new account here. @martipops, could you confirm with yours? ### Sources - The endpoint and its request body, from the bug report above (an interface fact, no launcher code read). The URL also appears in public issue threads: [MultiMC #5307](https://github.com/MultiMC/Launcher/issues/5307), [Prism Launcher #5627](https://github.com/PrismLauncher/PrismLauncher/issues/5627). - A black-box call with a dummy token answers `401 {"path": "/launcher/login", "error": "UNAUTHORIZED"}`, the same error shape as `login_with_xbox`. - `login_with_xbox` and the rest of the chain: [minecraft.wiki: Microsoft authentication](https://minecraft.wiki/w/Microsoft_authentication). **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at 1816cf0b5, 3 min 11 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +89 −12 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ (1 s) | | Python tests | ✅ 408 passed (2 min 29 s) | | rustfmt | ➖ no Rust change | | clippy | ➖ no Rust change | | tests | ➖ no crate touched | | doc tests | ➖ no crate touched | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ (7 s) | | launcher clippy | ✅ (30 s) | | launcher tests | ✅ 262 passed (4 s) | | Parity | ➖ 1 affected, to run in CI (--quick): lan_integration | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:10:17 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#5107
No description provided.