Skip to content

Support tenant propagation and refresh tokens in client credentials - #54

Merged
einari merged 3 commits into
mainfrom
feat/client-credentials-tenant-and-refresh-tokens
Jul 10, 2026
Merged

Support tenant propagation and refresh tokens in client credentials#54
einari merged 3 commits into
mainfrom
feat/client-credentials-tenant-and-refresh-tokens

Conversation

@einari

@einari einari commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Extends the back-channel client-credentials flow: a verified request can now carry a tenant through to the proxied service, and clients can refresh an access token without resending their client secret.

Added

  • The client-credentials verification endpoint's 2xx response may now include a tenant JSON property. AuthProxy embeds it in the issued token as a cratis/tenant claim, which the existing Claim tenant-resolution strategy can resolve into the Tenant-ID header on proxied requests.
  • POST /.cratis/token now also accepts grant_type=refresh_token, exchanging a refresh token for a new access/refresh token pair without recontacting the verification endpoint. Every successful client_credentials grant now returns a refresh_token alongside the access token.

Changed

  • Documented the new tenant-propagation and refresh-token behavior in authentication.md, services.md, and tenancy.md.

einari added 3 commits July 10, 2026 08:11
- A verification endpoint's 2xx response can now include a tenant JSON
  property; AuthProxy embeds it as a cratis/tenant claim on the issued
  token so the existing Claim tenant-resolution strategy can resolve it
  and set the Tenant-ID header on proxied requests, exactly as it does
  for every other tenant source.
- Every client_credentials grant now also mints a refresh token, issued
  under its own Data Protection purpose so it can never be used as an
  access token (or vice versa). /.cratis/token accepts
  grant_type=refresh_token to exchange a refresh token for a new
  access/refresh token pair without resending the client secret.
Covers tenant round-tripping through both access and refresh tokens,
the Claim-based tenant exposure on the authenticated principal, the
refresh_token grant's success and failure paths, and rejection when an
access token and refresh token are used in place of one another.
Explains the optional tenant property on the verification response,
how it maps onto the existing Claim tenant-resolution strategy, and
the new refresh_token grant flow with its lack of a revocation list.
@einari einari added the minor label Jul 10, 2026
@einari
einari merged commit a556737 into main Jul 10, 2026
3 checks passed
@einari
einari deleted the feat/client-credentials-tenant-and-refresh-tokens branch July 10, 2026 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant