Skip to content

Authorization server: exchange only access tokens issued with offline_access into refresh tokens #7029

Closed

Description

@ChrisJBurns

Part of #6886.

Problem

A configured delegate client with a token_exchange policy can exchange a user's access token for an exchange-grant refresh token, a long-lived grant bound to the delegate and the user. v0.60.0 does not check which scopes the subject token was issued with. So an access token from a sign-in where the user or the upstream IdP declined offline_access converts into lasting access just like one where the user consented.

#6990 planned for the handler to require offline_access, but #7003 shipped without the check.

Mecatl's design converts only sign-ins that consented to access that continues after the user leaves (credentials-and-lifecycle.md, step 3, check 4). The Mecatl TUI always requests offline_access.

Change

When a token exchange's output is a refresh token, refuse a subject token that was not issued with the offline_access scope. The refusal is invalid_request with the reason subject_token_invalid, because a fresh sign-in that grants the scope can pass. The rule could be a per-delegate option, on by default for exchange-grant refresh tokens.

This differs from requesting offline_access from the upstream IdP (#6978).

Acceptance

  • A subject token issued with offline_access converts.
  • A subject token issued without it is refused with subject_token_invalid, and no grant is created.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions