Skip to content

Schedule refresh tokens through token exchange #6896

Closed

Description

@jhrozek

Part of #6886. Depends on #6894, #6895 and #6897.

Problem: an unattended run (for example a scheduled agent task) has no user present, but needs the user's authority, revocably and for a bounded time.

Change:

  • Token exchange returns a schedule refresh token (requested_token_type=refresh_token, one schedule authorization_details entry) from the user's fresh access token for the client's API, with the same checks as opening a session in Refresh tokens through token exchange, as generic grants #6897: the client is authenticated, the subject token is this server's own and active, the entry's owner equals its sub_id, the key is new, the subject token's jti is converted once. The delegate-client exemption and may_act never apply.
  • It is bound to the client, the schedule, the user and the allowed targets (recorded on the row, Storage for grants issued by token exchange #6895). Lifetime: the schedule's horizon, capped by a configured maximum, never the subject token's expiry; a replacement never extends it. It does not rotate, and the ordinary refresh-token grant refuses it.
  • When the schedule fires, the client exchanges it (subject_token_type=refresh_token, validated from Storage for grants issued by token exchange #6895's storage) for a session refresh token on a new key, capped at the horizon, with the schedule row recorded as its parent. From there the run requests ID-JAGs as an interactive session does (ID-JAG issuance through token exchange #6898).
  • Output fixed: a schedule refresh token can produce only session refresh tokens.
  • Revoking the schedule refresh token revokes its child session refresh tokens. After a revocation, renewing the schedule creates a new token on a new key.
  • Refusals use the session-open reason codes, plus schedule_ended once the horizon has passed.

Acceptance: a fired schedule gets a session refresh token that yields ID-JAGs; revoking the schedule stops its running sessions from minting new ID-JAGs; a run cannot outlive the horizon.

Activity

  1. added
    needs-triage
    on Oct 21, 2026
  2. removed
    needs-triage
    on Oct 24, 2026
  3. self-assigned this
    on Oct 24, 2026
  4. jhrozek commented on Oct 27, 2026

    @jhrozek
    ContributorAuthor

    Closing as covered by #6897. After the redesign the authorization server has no notion of a schedule: a client's schedule is a grant that issues refresh tokens, with the horizon as its capped expires_at, and each run gets a child grant that issues ID-JAGs, expires no later than its parent, and stops when the parent is revoked. All of that is in #6897. Renewal is a new grant, which the client handles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions