msa-auth

Implements Microsoft account device-code login, token refresh, and keyring storage for Minecraft launches.

Updated Sep 8, 2026
One-click install
npx skills add https://github.com/Sixdd6/grid-craft-launcher --skill msa-auth-sixdd6
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: msa-auth
Source: https://github.com/Sixdd6/grid-craft-launcher/tree/main/.claude/skills/msa-auth
Command: npx skills add https://github.com/Sixdd6/grid-craft-launcher --skill msa-auth-sixdd6

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It provides the complete reference for the Microsoft account authentication chain in the GRID Craft Launcher, so changes to gcl-core auth code, token storage, or launch arguments follow the correct OAuth device-code flow without leaking secrets. ## Core Features & Use Cases - Device-Code Login Chain: Documents the six-step flow from device code through Xbox Live, XSTS, and Minecraft login to profile retrieval, including XErr error mapping. - Token Storage & Refresh: Covers refresh token rotation in the OS keyring or a 0600-permission file fallback, Minecraft token caching in accounts.json, and the five-minute refresh margin. - Offline Accounts & Launch Placeholders: Explains offline UUID derivation and the LaunchIdentity placeholders used for both Microsoft and offline accounts. - Use Case: Before modifying gcl-core/src/auth/ or adding account-related launch arguments, consult this Skill to handle cancellation, secret redaction, and error cases like Error::SignInAgain correctly. ## Quick Start Read this Skill before editing any code under gcl-core auth or account-related launch arguments in the launcher.

Frequently Asked Questions about msa-auth

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement Microsoft device-code login for Minecraft in Rust?▼

Follow the six-step chain: request a device code, poll the token endpoint, authenticate with Xbox Live, then XSTS, then Minecraft login, and finally fetch the profile. Each step maps specific error responses like authorization_pending, slow_down, and XErr codes to typed errors.

How should Minecraft launcher refresh tokens be stored securely?▼

Store refresh tokens in the OS keyring via a SecretStore abstraction, falling back to a secrets.json file written atomically with 0600 permissions when the keyring probe fails. Only the refresh token and the cached Minecraft token are persisted, never the MSA access token.

Why does Minecraft login return HTTP 403 after Xbox authentication?▼

A 403 from the Minecraft login endpoint means the Azure app registration has not been approved through the Minecraft launcher approval form. This maps to Error::InvalidAppRegistration and requires completing the approval process for the client id.

What do Xbox XSTS XErr codes 2148916233 and 2148916238 mean?▼

Code 2148916233 means the Microsoft account has no Xbox profile and the user must create one at xbox.com. Code 2148916238 indicates a child account that an adult must add to a family group before sign-in works.

Can a Minecraft launcher work without a Microsoft client id?▼

Yes, offline accounts launch without any client id, and Microsoft accounts with a still-valid cached token also launch. A token needing refresh without a configured client id returns Error::Disabled.