Keep long Microsoft sign-in secrets in several keychain items
Credential Manager takes at most 2560 bytes per item. The secrets of a Microsoft sign-in (the refresh token and the Minecraft token) are longer, so saving them failed on Windows with "password encoded as UTF-16 is longer than platform limit of 2560 chars" and the sign-in did not finish. On macOS and Windows a secret is now split over the items `<uuid>`, `<uuid>.1`, `<uuid>.2`... of at most 1000 UTF-8 bytes each (under 2560 bytes of UTF-16). Reads join the pieces, a write removes the leftovers of a longer secret, and sign-out removes all of them. Existing single items keep working. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -74,7 +74,8 @@ one is selected. "Sign out" deletes the account's secrets from the keychain.
|
||||
- Secrets (the Microsoft refresh token, the Minecraft access token and its expiry) go to the OS
|
||||
keychain, one item per account: Keychain on macOS, Credential Manager on Windows, the Secret
|
||||
Service (GNOME Keyring, KWallet) on Linux. Service name `dev.playhorizon.launcher`, account = the
|
||||
Minecraft UUID.
|
||||
Minecraft UUID. Credential Manager takes at most 2560 bytes per item, which the secrets of a sign-in
|
||||
exceed: on macOS and Windows a longer secret is split over the items `<uuid>`, `<uuid>.1`, `<uuid>.2`...
|
||||
- `accounts.json` in the launcher's data folder keeps only public data: UUID, name, skin URL, which
|
||||
account is selected. Never a token.
|
||||
- No keychain available (a Linux box without a Secret Service, a locked keychain): sign-in still
|
||||
|
||||
Reference in New Issue
Block a user