Skip to content

feat(identity): advertise native sign-in scopes for durable MCP sign-in - #724

Merged
Knucklessg1 merged 2 commits into
mainfrom
feat/mcp-offline-signin
Nov 17, 2026
Merged

Knucklessg1 merged 2 commits into
mainfrom
feat/mcp-offline-signin

Conversation

@Knucklessg1

Copy link
Copy Markdown
Member

What changed and why

A long-running coding session (days) must never have to sign in again. Today a native coding client receives an ordinary session refresh token. It expires after 30 minutes idle and at the maximum session age, so an idle or long session loses its sign-in.

The identity provider issues an offline refresh token only when the sign-in requests the offline_access scope. Arbora's contract already attaches that scope to the native client, but arbora never asked clients to request it: the protected-resource metadata listed no scopes_supported, and the 401 challenge carried no scope.

  • The protected-resource metadata scopes_supported and the scope parameter of the 401 WWW-Authenticate challenge now carry the native client sign-in scopes, including offline_access. They are read from the one declared client contract, through native_signin_scopes in the identity ports. There is no second list. The change uses the supported scopes_supported and challenge_scopes parameters of the MCP framework's remote auth provider.
  • This is advertising only. required_scopes verification is unchanged, so service and client-credential tokens without offline_access are still accepted, and a configured required scope is still enforced.
  • /health/ready now always reports identity: ready, checking, degraded (with the reconciler failure code), stopped, and the new unconfigured (no client contract configured) and degraded with identity_config_invalid (a contract is set but cannot be read; before, the supervisor refused it and readiness said nothing). It reports codes only and never gates readiness.
  • Spec rows ARBORA-IDENTITY-R030.4.8 and ARBORA-IDENTITY-R030.4.9 extend the R030.4 family. The rollup, test spec, tasks and plan are updated.
  • The realm session timeouts are not changed: they apply to every browser sign-in.

Impact

Clients that follow the advertised scopes receive offline refresh tokens on their next sign-in. Existing sessions keep their current tokens until they sign in again. /health/ready gains an identity field on deployments that had none; it is non-gating.

Verification

  • New tests in tests/identity/test_native_signin_scopes.py: metadata scopes equal the contract scopes and include offline_access; the challenge carries the same list; tokens without offline_access are still accepted while a required scope is still enforced; readiness reports each identity state; and a served sign-in that follows the advertised scopes against a fake identity provider receives an offline refresh token, while one that ignores them does not.
  • Full test suite passes locally. All pre-commit and pre-push gates pass, including the spec standard, decomposition, trailers and the identity port boundary test.

🤖 Generated with Claude Code

Knucklessg1 and others added 2 commits November 17, 2026 11:06
A native coding client received a session refresh token that dies after 30
minutes idle and at the maximum session age, so a harness session lasting
days lost its sign-in. The identity provider issues an offline token only
when the sign-in requests `offline_access`, and arbora advertised no scope.

The protected-resource metadata `scopes_supported` and the `scope` parameter
of the 401 challenge now carry the native client sign-in scopes, read from
the one client contract. This is advertising only: `required_scopes` is
unchanged, so tokens without `offline_access` still pass. Realm session
timeouts are not changed.

`/health/ready` now always reports `identity`, adding `unconfigured` (no
contract configured) and `degraded` with `identity_config_invalid` (a
configured contract that cannot be read). It reports codes only and never
gates readiness.

Spec: ARBORA-IDENTITY-R030.4.8, ARBORA-IDENTITY-R030.4.9
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The plan for the identity spec lacked the Phase 1 design answers that the
spec standard checks once a spec is touched. This adds the spec-wide answers
and the section for the sign-in scope advertisement.

Spec: ARBORA-IDENTITY-R030.4.8, ARBORA-IDENTITY-R030.4.9
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Knucklessg1

Copy link
Copy Markdown
Member Author

CI required

@Knucklessg1
Knucklessg1 merged commit d36c2f5 into main Nov 17, 2026
5 of 6 checks passed
@Knucklessg1
Knucklessg1 deleted the feat/mcp-offline-signin branch November 17, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant