Skip to content

feat: Remember the SSO sign-in in the OS credential store - #4

Merged
HQJaTu merged 1 commit into
mainfrom
topic/SSO-token-cache
Oct 7, 2026
Merged

HQJaTu merged 1 commit into
mainfrom
topic/SSO-token-cache

Conversation

@HQJaTu

@HQJaTu HQJaTu commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

Releases as 1.1.0 (minor-version label).

What

token-cache = "keyring" in [m-files.tool.grpc] keeps the OAuth refresh token in the operating system's credential store (Windows Credential Manager, macOS Keychain, Secret Service on Linux). After the first browser sign-in, later runs trade it for a fresh token with one call to the IdP, with no browser and no MFA.

  • Opt-in, through the new [keyring] extra: pip install "mfiles-grpc[keyring]"
  • A rotated refresh token replaces the remembered one. A refused one is forgotten, and the browser signs in again.
  • A credential store that can't be reached is logged and ignored, so it never stops a sign-in.
  • Only the refresh token is stored. No token reaches a log line, an error message or a repr.
  • New mfiles-grpc forget-token command removes the remembered sign-in.
  • Without the setting, acquire_token is called exactly as before.
  • auth = "password" ignores the setting, and MFILES_GRPC_TOKEN still wins.

Tests

102 passed, with the keyring extra installed.

🤖 Generated with Claude Code

token-cache = "keyring" keeps the OAuth refresh token in the operating
system's credential store, so later runs get a token without the browser
or MFA. Opt-in, with the new [keyring] extra. A rotated refresh token
replaces the remembered one, a refused one is forgotten and the browser
signs in again, and a broken credential store never stops a sign-in.

mfiles-grpc forget-token removes the remembered sign-in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@HQJaTu HQJaTu added the minor-version Release bumps the minor version (1.2.3 → 1.3.0) label Oct 7, 2026
@HQJaTu
HQJaTu merged commit ef12e8f into main Oct 7, 2026
5 checks passed
@HQJaTu
HQJaTu deleted the topic/SSO-token-cache branch October 7, 2026 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor-version Release bumps the minor version (1.2.3 → 1.3.0)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant