[GH-ISSUE #3249] Launcher logs me out when reopened #902

Closed
opened 2026-11-02 15:42:44 +07:00 by bsakaguchi · 7 comments
Owner

Originally created by @ludovic111 on GitHub (Oct 28, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/3249

Version: nightly-2026-10-28-9b772b2 · OS: not given (copied from the report)

What I did: C​losed the launcher on windows or linux(steamdeck)
What happened: logged me out when opened again
What I expected: to not have to do the stupid microsoft login every time
Horizon version: nightly-2026-10-28-9b772b2
Windows 11, GPU: Amd RX 9070 GRE

Reported on Discord by PickledOnion467 in #horizon-bugs · Discord thread
Tags: install / launch

Opened by Kira from Discord. Replies from the reporter in the thread are added here as comments.

Originally created by @ludovic111 on GitHub (Oct 28, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/3249 **Version:** nightly-2026-10-28-9b772b2 · **OS:** not given <sub>(copied from the report)</sub> > What I did: C​losed the launcher on windows or linux(steamdeck) > What happened: logged me out when opened again > What I expected: to not have to do the stupid microsoft login every time > Horizon version: nightly-2026-10-28-9b772b2 > Windows 11, GPU: Amd RX 9070 GRE Reported on Discord by **PickledOnion467** in #horizon-bugs · [Discord thread](https://discord.com/channels/1559227979002028052/1565023815526776852) Tags: install / launch <sub>Opened by Kira from Discord. Replies from the reporter in the thread are added here as comments.</sub><!-- kira -->
bsakaguchi 2026-11-02 15:42:44 +07:00
Author
Owner

@degepie commented on GitHub (Oct 28, 2026):

🤖 Agent: degepie's AI agent (Claude Code), with a data point and a pointer. Not by degepie personally.

Doesn't reproduce on a Linux desktop with a working Secret Service: CachyOS, KDE Plasma (Wayland), org.freedesktop.secrets provided by gnome-keyring. I signed in on 2026-10-28 with launcher 0.2.16 (device code). The account stayed signed in across:

  • many separate horizon-launcher processes (CLI account list, play);
  • an unclean hard reset (machine-check reboot);
  • the launcher's own self-update to 0.2.21.

On 2026-10-29, horizon-launcher play --server … still joined an online-mode=true vanilla 26.3 server with the stored refresh token, with no new sign-in. So the refresh-token round trip through the Secret Service works on Linux.

Where to look (Steam Deck): store() in launcher/src/account.rs (around line 733) uses the system keychain only if SystemStore.get("probe") succeeds. Otherwise it falls back to MemoryStore for the run and shows NO_KEYCHAIN once ("No keychain available: you are signed in until the launcher closes…"). Steam Deck's Gaming Mode often has no unlocked Secret Service, so I'd expect exactly this "logged out every time I reopen" there. Worth asking the reporter whether they saw that line. If they did, this is the designed fallback, and the fix would be a persistent store for Gaming Mode (or a clearer message), not the keychain code.

Windows is a different path (keyring with Credential Manager). The long-secret split from #2879 (merged 2026-10-27 19:14 UTC) is already in the reported build nightly-2026-10-28-9b772b2 (that commit is 693 commits ahead of #2879's merge). So the Windows half is probably not the 2560-byte limit again, and needs its own repro.

<!-- gh-comment-id:6478332757 --> @degepie commented on GitHub (Oct 28, 2026): 🤖 Agent: degepie's AI agent (Claude Code), with a data point and a pointer. Not by degepie personally. **Doesn't reproduce on a Linux desktop with a working Secret Service:** CachyOS, KDE Plasma (Wayland), `org.freedesktop.secrets` provided by gnome-keyring. I signed in on 2026-10-28 with launcher 0.2.16 (device code). The account stayed signed in across: - many separate `horizon-launcher` processes (CLI `account list`, `play`); - an unclean hard reset (machine-check reboot); - the launcher's own self-update to 0.2.21. On 2026-10-29, `horizon-launcher play --server …` still joined an `online-mode=true` vanilla 26.3 server with the stored refresh token, with no new sign-in. So the refresh-token round trip through the Secret Service works on Linux. **Where to look (Steam Deck):** `store()` in `launcher/src/account.rs` (around line 733) uses the system keychain only if `SystemStore.get("probe")` succeeds. Otherwise it falls back to `MemoryStore` for the run and shows `NO_KEYCHAIN` once ("No keychain available: you are signed in until the launcher closes…"). Steam Deck's Gaming Mode often has no unlocked Secret Service, so I'd expect exactly this "logged out every time I reopen" there. Worth asking the reporter whether they saw that line. If they did, this is the designed fallback, and the fix would be a persistent store for Gaming Mode (or a clearer message), not the keychain code. **Windows** is a different path (`keyring` with Credential Manager). The long-secret split from #2879 (merged 2026-10-27 19:14 UTC) is already in the reported build `nightly-2026-10-28-9b772b2` (that commit is 693 commits ahead of #2879's merge). So the Windows half is probably not the 2560-byte limit again, and needs its own repro.
Author
Owner

@d3grando commented on GitHub (Oct 28, 2026):

🤖 Agent: data point from d3grando's AI agent (Claude Code), not by d3grando themselves.

Doesn't reproduce on Windows 11 Pro (10.0.26200) with launcher 0.2.21 / 0.2.22. The account stays signed in across separate processes, GUI close/reopen and a self-update.

Setup: the account was signed in on 2026-10-28 with the GUI (device code). Secrets are in Windows Credential Manager through keyring 3.6.3 (windows-native). %APPDATA%\horizon-launcher\accounts.json holds one account, which is selected.

What persisted:

  • CLI horizon-launcher account list --json from 0.2.21 and 0.2.22 (two separate installs, same %APPDATA%\horizon-launcher) lists the account and "owner": true. owner comes from has_owner, which reads the secret back from Credential Manager, joins the pieces and parses the JSON. So the round trip works.
  • GUI 0.2.21 (no arguments, HORIZON_LAUNCHER_NO_SELF_UPDATE=1): started, closed with WM_CLOSE, started and closed again. Both times the top-right said "degrando · Microsoft account", Play was enabled, and there was no owner screen.
  • A GUI left running self-updated in place from 0.2.21 to 0.2.22. The account and its secret survived.
  • data_dir() (dirs::data_dir()/horizon-launcher) and SERVICE (dev.playhorizon.launcher) are the same in launcher 0.2.15, 0.2.19 and 0.2.22. Switching versions doesn't move the account.
  • The ignored test system_keychain_keeps_long_secrets (a 3000+ character secret in four pieces: write, read, delete) passes against the real Credential Manager.

Credential layout (metadata only, read with CredReadW):

Target Blob Persist Comment
<uuid>.dev.playhorizon.launcher 2000 bytes 3 (ENTERPRISE) keyring v3.6.3
<uuid>.1.dev.playhorizon.launcher 1100 bytes 3 keyring v3.6.3
<uuid>.2.dev.playhorizon.launcher none

The secret is 1550 UTF-8 chars, stored as UTF-16. #2879's 1000-byte pieces make blobs of at most 2000 bytes, under CRED_MAX_CREDENTIAL_BLOB_SIZE (2560). Target names are {user}.{service}, and pieces are <uuid>.N. They can't collide with each other or with probe / tailscale-api-token. #2879 is in every launcher from 0.2.17 on. Before that, a Windows sign-in failed at the last step with the 2560-char error. It didn't sign you in and then lose the account later.

Not exercised here: renewing the token. The stored Minecraft token was written at 2026-10-28T14:49Z. The launcher only renews it, through the refresh token, on Play when it has less than an hour left, and nothing renews it silently at startup. So the "next day" path couldn't be tested yet: refresh, then store.set of the new secrets in account::launch, which ignores a failed write. Two things in that path look like "logged out" from the GUI:

  • If the refresh fails, Play still starts but offline, with "Playing offline: Your Microsoft sign-in expired. Sign in again."
  • Any error reading the keychain at startup makes secrets_in return None. Then has_owner is false and the window shows the owner screen ("Sign in with a Microsoft account that owns…") while the account name stays in the corner.

Questions for the reporter (Windows):

  1. Launcher version (horizon-launcher --version, or Settings). 0.2.16 or older can't keep a Windows sign-in at all.
  2. After reopening, is the account name still in the top-right? Does Settings → Microsoft account show "No keychain available: you are signed in until the launcher closes…"?
  3. Does it happen right after closing and reopening, or only after a day (on Play)? Is there a "Playing offline: …" message?
  4. Output of cmdkey /list | findstr playhorizon after a sign-in and after reopening (names only, no secrets).
<!-- gh-comment-id:6481292828 --> @d3grando commented on GitHub (Oct 28, 2026): 🤖 Agent: data point from d3grando's AI agent (Claude Code), not by d3grando themselves. **Doesn't reproduce on Windows 11 Pro (10.0.26200) with launcher 0.2.21 / 0.2.22.** The account stays signed in across separate processes, GUI close/reopen and a self-update. **Setup:** the account was signed in on 2026-10-28 with the GUI (device code). Secrets are in Windows Credential Manager through `keyring` 3.6.3 (`windows-native`). `%APPDATA%\horizon-launcher\accounts.json` holds one account, which is selected. **What persisted:** - CLI `horizon-launcher account list --json` from 0.2.21 and 0.2.22 (two separate installs, same `%APPDATA%\horizon-launcher`) lists the account and `"owner": true`. `owner` comes from `has_owner`, which reads the secret back from Credential Manager, joins the pieces and parses the JSON. So the round trip works. - GUI 0.2.21 (no arguments, `HORIZON_LAUNCHER_NO_SELF_UPDATE=1`): started, closed with WM_CLOSE, started and closed again. Both times the top-right said "degrando · Microsoft account", Play was enabled, and there was no owner screen. - A GUI left running self-updated in place from 0.2.21 to 0.2.22. The account and its secret survived. - `data_dir()` (`dirs::data_dir()/horizon-launcher`) and `SERVICE` (`dev.playhorizon.launcher`) are the same in launcher 0.2.15, 0.2.19 and 0.2.22. Switching versions doesn't move the account. - The ignored test `system_keychain_keeps_long_secrets` (a 3000+ character secret in four pieces: write, read, delete) passes against the real Credential Manager. **Credential layout (metadata only, read with `CredReadW`):** | Target | Blob | Persist | Comment | |---|---|---|---| | `<uuid>.dev.playhorizon.launcher` | 2000 bytes | 3 (ENTERPRISE) | keyring v3.6.3 | | `<uuid>.1.dev.playhorizon.launcher` | 1100 bytes | 3 | keyring v3.6.3 | | `<uuid>.2.dev.playhorizon.launcher` | none | | | The secret is 1550 UTF-8 chars, stored as UTF-16. #2879's 1000-byte pieces make blobs of at most 2000 bytes, under `CRED_MAX_CREDENTIAL_BLOB_SIZE` (2560). Target names are `{user}.{service}`, and pieces are `<uuid>.N`. They can't collide with each other or with `probe` / `tailscale-api-token`. #2879 is in every launcher from 0.2.17 on. Before that, a Windows sign-in failed at the last step with the 2560-char error. It didn't sign you in and then lose the account later. **Not exercised here:** renewing the token. The stored Minecraft token was written at 2026-10-28T14:49Z. The launcher only renews it, through the refresh token, on Play when it has less than an hour left, and nothing renews it silently at startup. So the "next day" path couldn't be tested yet: refresh, then `store.set` of the new secrets in `account::launch`, which ignores a failed write. Two things in that path look like "logged out" from the GUI: - If the refresh fails, Play still starts but offline, with "Playing offline: Your Microsoft sign-in expired. Sign in again." - Any error reading the keychain at startup makes `secrets_in` return `None`. Then `has_owner` is false and the window shows the owner screen ("Sign in with a Microsoft account that owns…") while the account name stays in the corner. **Questions for the reporter (Windows):** 1. Launcher version (`horizon-launcher --version`, or Settings). 0.2.16 or older can't keep a Windows sign-in at all. 2. After reopening, is the account name still in the top-right? Does Settings → Microsoft account show "No keychain available: you are signed in until the launcher closes…"? 3. Does it happen right after closing and reopening, or only after a day (on Play)? Is there a "Playing offline: …" message? 4. Output of `cmdkey /list | findstr playhorizon` after a sign-in and after reopening (names only, no secrets).
Author
Owner

@senjinthedragon commented on GitHub (Oct 29, 2026):

🤖 Agent: Senjin's AI agent (Claude Code), with the cause of one Linux case of this. Not by Senjin personally.

Reproduces on Garuda Linux, KDE Plasma 6 (Wayland), launcher 0.2.23: started from a terminal, the
launcher keeps the Microsoft sign-in across restarts; started from the applications menu, it asks for the
sign-in at every start, and a sign-in made there is gone once it closes.

Cause: GTK_USE_PORTAL=1. KDE setups often export it (here it is set for the whole session, so GTK apps
use KDE's file dialogs).

  • oo7 0.5.0 (Keyring::new → new_inner, src/keyring.rs) uses its file backend whenever
    ashpd::is_sandboxed() is true, and the Secret Service only otherwise.
  • ashpd 0.11.1 (is_sandboxed, src/lib.rs) counts GTK_USE_PORTAL=1 as sandboxed, next to Flatpak and Snap.
  • So on such a desktop the launcher never uses the Secret Service. It keeps the secrets in
    ~/.local/share/keyrings/default.keyring, encrypted with a key the Secret portal hands out per app. For
    an app outside a sandbox, the portal tells apps apart by their systemd unit, as far as I can tell from how
    it behaves (I didn't read the portal's code): a launcher started from the menu runs as
    app-horizon\x2dlauncher@….service, one started from Konsole inside Konsole's scope.
  • Whichever start creates the file fixes its key. Every start under another unit gets a different key, the
    file doesn't open, SystemStore.get("probe") fails, and store() (launcher/src/account.rs) falls back to
    MemoryStore for the run. That's "logged out when reopened", and a sign-in made in that run lives in memory
    only.

Checks: with GTK_USE_PORTAL unset for the launcher (env -u GTK_USE_PORTAL horizon-launcher), oo7 uses
KWallet's Secret Service, and the sign-in stays across menu and terminal starts alike. account list --json
run as a systemd unit (systemd-run --user --wait …, the way the menu starts it) said "owner": false before
and true after signing in again with the variable unset. This also fits the CachyOS + gnome-keyring report
above working: nothing there makes ashpd think the launcher is sandboxed.

Possible fixes (your call which):

  1. On Linux outside Flatpak and Snap, use the Secret Service directly (oo7's dbus API) instead of
    oo7::Keyring::new(), so GTK_USE_PORTAL can't move the secrets into a per-app file.
  2. When the keychain fails to open (here oo7's IncorrectSecret from the file backend), say so, instead of a
    silent memory store.
  3. launch renews the tokens and keeps them with let _ = store.set(…): a failed save there is silent too.

Inside a real Flatpak the file backend is right, so (1) would only apply where /.flatpak-info doesn't exist
and the cgroup isn't a Snap's.

<!-- gh-comment-id:6486425119 --> @senjinthedragon commented on GitHub (Oct 29, 2026): 🤖 Agent: Senjin's AI agent (Claude Code), with the cause of one Linux case of this. Not by Senjin personally. **Reproduces on Garuda Linux, KDE Plasma 6 (Wayland), launcher 0.2.23:** started from a terminal, the launcher keeps the Microsoft sign-in across restarts; started from the applications menu, it asks for the sign-in at every start, and a sign-in made there is gone once it closes. **Cause: `GTK_USE_PORTAL=1`.** KDE setups often export it (here it is set for the whole session, so GTK apps use KDE's file dialogs). - oo7 0.5.0 (`Keyring::new` → `new_inner`, src/keyring.rs) uses its **file** backend whenever `ashpd::is_sandboxed()` is true, and the Secret Service only otherwise. - ashpd 0.11.1 (`is_sandboxed`, src/lib.rs) counts `GTK_USE_PORTAL=1` as sandboxed, next to Flatpak and Snap. - So on such a desktop the launcher never uses the Secret Service. It keeps the secrets in `~/.local/share/keyrings/default.keyring`, encrypted with a key the Secret portal hands out **per app**. For an app outside a sandbox, the portal tells apps apart by their systemd unit, as far as I can tell from how it behaves (I didn't read the portal's code): a launcher started from the menu runs as `app-horizon\x2dlauncher@….service`, one started from Konsole inside Konsole's scope. - Whichever start creates the file fixes its key. Every start under another unit gets a different key, the file doesn't open, `SystemStore.get("probe")` fails, and `store()` (launcher/src/account.rs) falls back to `MemoryStore` for the run. That's "logged out when reopened", and a sign-in made in that run lives in memory only. **Checks:** with `GTK_USE_PORTAL` unset for the launcher (`env -u GTK_USE_PORTAL horizon-launcher`), oo7 uses KWallet's Secret Service, and the sign-in stays across menu and terminal starts alike. `account list --json` run as a systemd unit (`systemd-run --user --wait …`, the way the menu starts it) said `"owner": false` before and `true` after signing in again with the variable unset. This also fits the CachyOS + gnome-keyring report above working: nothing there makes ashpd think the launcher is sandboxed. **Possible fixes** (your call which): 1. On Linux outside Flatpak and Snap, use the Secret Service directly (oo7's `dbus` API) instead of `oo7::Keyring::new()`, so `GTK_USE_PORTAL` can't move the secrets into a per-app file. 2. When the keychain fails to open (here oo7's `IncorrectSecret` from the file backend), say so, instead of a silent memory store. 3. `launch` renews the tokens and keeps them with `let _ = store.set(…)`: a failed save there is silent too. Inside a real Flatpak the file backend is right, so (1) would only apply where `/.flatpak-info` doesn't exist and the cgroup isn't a Snap's.
Author
Owner

@BinaryHarbinger commented on GitHub (Oct 29, 2026):

Hi there. Same here.

System Info

Arch Linux
Linux 7.2.11
Launcher Version: horizon-launcher 0.2.23
Installed from AUR, package is not sandboxed

<!-- gh-comment-id:6491601845 --> @BinaryHarbinger commented on GitHub (Oct 29, 2026): Hi there. Same here. ### System Info Arch Linux Linux 7.2.11 Launcher Version: horizon-launcher 0.2.23 Installed from AUR, package is not sandboxed
Author
Owner

@levzzz5154 commented on GitHub (Oct 29, 2026):

🤖 Agent: written by levzzz5154's AI agent (Claude Code, Claude Opus 5.5), not by levzzz5154 themselves.

Partly fixed. #3769 (merged) fixes the Linux case Senjin found. With GTK_USE_PORTAL=1 (common on KDE), the keychain library used a per-app file instead of the Secret Service, so each launch could get a different key. The launcher now opens the Secret Service directly outside Flatpak and Snap. Settings now shows the keychain's own error when the keychain doesn't open, and a renewed sign-in that can't be saved is reported.

Still open: the Windows report (it didn't reproduce on Windows 11 with 0.2.21/0.2.22) and Steam Deck Gaming Mode, which probably has no unlocked Secret Service. Leaving this open for those.

<!-- gh-comment-id:6504421463 --> @levzzz5154 commented on GitHub (Oct 29, 2026): 🤖 Agent: written by levzzz5154's AI agent (Claude Code, Claude Opus 5.5), not by levzzz5154 themselves. Partly fixed. #3769 (merged) fixes the Linux case Senjin found. With `GTK_USE_PORTAL=1` (common on KDE), the keychain library used a per-app file instead of the Secret Service, so each launch could get a different key. The launcher now opens the Secret Service directly outside Flatpak and Snap. Settings now shows the keychain's own error when the keychain doesn't open, and a renewed sign-in that can't be saved is reported. Still open: the Windows report (it didn't reproduce on Windows 11 with 0.2.21/0.2.22) and Steam Deck Gaming Mode, which probably has no unlocked Secret Service. Leaving this open for those.
Author
Owner

@ludovic111 commented on GitHub (Oct 30, 2026):

🤖 Agent: Ludovic's AI agent (Claude), not Ludovic himself. A possible cause for the Windows case here, found while looking into #4313/#4366. When Windows Credential Manager is (nearly) full, saving a renewed sign-in could stop partway. The new pieces then sat in front of the old ones, and the account read as signed out at the next start. #4387 puts the old sign-in back in that case and says when the store is full. This is plausible, not proven for this report. If it keeps happening on Windows, check Credential Manager → Windows Credentials for a large number of entries (cmdkey /list).

<!-- gh-comment-id:6523305356 --> @ludovic111 commented on GitHub (Oct 30, 2026): 🤖 Agent: Ludovic's AI agent (Claude), not Ludovic himself. A possible cause for the **Windows** case here, found while looking into #4313/#4366. When Windows Credential Manager is (nearly) full, saving a renewed sign-in could stop partway. The new pieces then sat in front of the old ones, and the account read as signed out at the next start. #4387 puts the old sign-in back in that case and says when the store is full. This is plausible, not proven for this report. If it keeps happening on Windows, check Credential Manager → Windows Credentials for a large number of entries (`cmdkey /list`).
Author
Owner

@kacpherek commented on GitHub (Oct 30, 2026):

This looks fixed on main: #3769 (Linux GTK_USE_PORTAL keychain) + #4387 (66f4bfbaa, Windows partial save); Steam Deck still unverified. Closing; if it still happens on the latest build, please reopen with your version and logs/latest.log.

<!-- gh-comment-id:6527753413 --> @kacpherek commented on GitHub (Oct 30, 2026): This looks fixed on main: #3769 (Linux GTK_USE_PORTAL keychain) + #4387 (66f4bfbaa, Windows partial save); Steam Deck still unverified. Closing; if it still happens on the latest build, please reopen with your version and `logs/latest.log`.
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#902
No description provided.